This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from python.common.Turtle import Turtle | |
| class Lsystem: | |
| def __init__(self, original_seq, rules, axioms): | |
| self.parsed_seq = [] | |
| self.original_seq = original_seq | |
| self.rules = rules | |
| self.axioms = axioms | |
| self.turtle = Turtle() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import math | |
| class Svg: | |
| def __init__(self, size=(-1, -1)): | |
| self.__svg_string = "<?xml version=\"1.0\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"" | |
| self.max_x = -sys.maxsize | |
| self.max_y = -sys.maxsize | |
| self.min_x = sys.maxsize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| class Line: | |
| def __init__(self, x1, y1, x2, y2, draw=True): | |
| self.x1 = x1 | |
| self.x2 = x2 | |
| self.y1 = y1 | |
| self.y2 = y2 | |
| self.draw = draw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from decimal import * | |
| import random | |
| import math | |
| from mpmath import mp | |
| time_max = 2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from python.common.line import Line | |
| from python.common.svg import Svg | |
| def star(density=30, size=100): | |
| svg = Svg((size, size)) | |
| for i in range(density): | |
| for j in range(2): | |
| svg.add_line( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {- | | |
| This is the fourth assignment for IB016, semester spring 2015. | |
| Name: Adam Melkus | |
| UID: 374010 | |
| == Obtaining weather information from http://openweathermap.org | |
| This time your task is to implement download and processing of weather data | |
| from <http://openweathermap.org>. Following it partially filled program, which | |
| already contains some data type definitions, 'main', argument parsing, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {- | This is the third assignment for IB016, semester spring 2015. | |
| Name: Adam Melkus | |
| UID: 374010 | |
| == Implementing du | |
| In this assignment you will be implementing simplified version of Unix | |
| utility @du@. This utility can be used to detect filesystem usage by | |
| files and directories. Your task is for the first time to implement whole | |
| compilable module, including commandline handling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from operator import itemgetter | |
| from python.common import line as ln | |
| from python.common.polygon import Polygon | |
| from python.common.svg import Svg | |
| from python.less5.generate_points import generate_points | |
| def less(a, b): | |
| return a < b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from python.common import line as ln | |
| from python.common.svg import Svg | |
| from python.less5.generate_points import generate_points | |
| def triangulate(number_of_points, canvas_size, sort=True, name="triangulation", gauss=False): | |
| svg = Svg() | |
| points = generate_points(number_of_points, canvas_size, gauss) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import radians, cos, sin | |
| import random | |
| from python.common.svg import Svg | |
| from python.less5.generate_points import generate_points, point_in_bounds | |
| from python.common import line as ln | |
| def generate_lines(n, length, canvas_size, gauss=False): | |
| lines = [] |