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 | |
| from PIL import Image | |
| def triangle(length=20): | |
| im = Image.new("RGB", (length, length), (255, 255, 255)) | |
| for x in range(length): | |
| for y in range(length): | |
| x_n, y_n = x - length / 2, length - y |
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 PIL import Image | |
| from python.common import line as ln | |
| def polygon(points): | |
| # first lets convert the points to lines | |
| lines = [] | |
| xmax = 0 | |
| ymax = 0 |
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 | |
| from PIL import Image | |
| def ellipse(major, minor, angle): | |
| ang_r = math.radians(angle) | |
| width = major * 2 | |
| heigth = major * 3 |
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 | |
| def create_tree(t=Turtle(), length=100, depth=1): | |
| if depth == 0: | |
| return t | |
| t.forward(length) | |
| t.left(30) | |
| lp = t.position | |
| create_tree(t, length / 1.1, depth - 1) |
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 | |
| def generate_points(n, canvas_size, gauss=False): | |
| points = [] | |
| for i in range(n): | |
| if gauss: | |
| x = -1 | |
| y = -1 | |
| while not (point_in_bounds((x, y,), canvas_size)): |
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 = [] |
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 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
| {- | 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
| {- | | |
| 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 |