Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from graphics import *
- import time
- def QuestionTwo():
- length = 500
- height = 20
- start = Point(5,5)
- global win
- win = GraphWin("window", 500, 150)
- cantor_set(win, start, length, height)
- win.getMouse()
- win.close()
- return
- def cantor_set(win, point, length, height):
- p = point.x
- q = point.y
- if length < 1:
- return
- LINE = Line(Point(p,q), Point(p+length,q))
- LINE.setWidth(50) ; LINE.draw(win)
- increment = length / 3
- q += height
- cantor_set(win, Point(p, q + height), increment, height)
- cantor_set(win, Point(p + length * (2/3) , q + height), increment, height)
- return
- QuestionTwo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement