HOME | DD

NumberoftheBeast — COMP51: Lab 3

Published: 2005-02-07 23:20:24 +0000 UTC; Views: 120; Favourites: 1; Downloads: 4
Redirect to original
Description look what I made! I'm a computer programming wizard!


here's the code for one of the images (it's in Python):

from graphics import *
from string import *


infile = open("c:/comp51/picture3.txt", "r")

line1 = infile.readline()

line2 = infile.readline()

line3 = infile. readline()

num_points = int(line3)

title = strip(line1)
winsize = split(line2, ',')
wincolor = winsize[0]
winsize = winsize[1:]
winwidth = int(strip(winsize[0]))
winheight = int(strip(winsize[1]))
win = GraphWin(title, winwidth, winheight)
win.setBackground(wincolor)

for i in range(num_points):
dataline = infile.readline()
dataline = split(dataline, ',')
linecolor = strip(dataline[0])
line = Line(Point(dataline[1], dataline[2]), Point(dataline[3],
dataline[4]))
line.setFill(linecolor)
line.setOutline(linecolor)
line.draw(win)


win.getMouse()
win.close()
Related content
Comments: 2

KaseiTsuki [2005-02-08 00:24:50 +0000 UTC]

beautiful martin, just beautiful.

👍: 0 ⏩: 1

NumberoftheBeast In reply to KaseiTsuki [2005-02-08 05:05:20 +0000 UTC]

isn't it? I was going to recreate the full works of Van Gogh, but I ran out of time...

👍: 0 ⏩: 0