Advertisement
Guest User

I made a picture for you

a guest
Mar 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. from graphics import *
  2. import time
  3.  
  4. def QuestionTwo():
  5.  
  6. length = 500
  7. height = 20
  8. start = Point(5,5)
  9.  
  10. global win
  11.  
  12. win = GraphWin("window", 500, 150)
  13.  
  14. cantor_set(win, start, length, height)
  15.  
  16. win.getMouse()
  17.  
  18. win.close()
  19.  
  20. return
  21.  
  22. def cantor_set(win, point, length, height):
  23.  
  24. p = point.x
  25. q = point.y
  26.  
  27. if length < 1:
  28. return
  29.  
  30. LINE = Line(Point(p,q), Point(p+length,q))
  31.  
  32. LINE.setWidth(50) ; LINE.draw(win)
  33.  
  34. increment = length / 3
  35. q += height
  36.  
  37.  
  38. cantor_set(win, Point(p, q + height), increment, height)
  39. cantor_set(win, Point(p + length * (2/3) , q + height), increment, height)
  40.  
  41. return
  42.  
  43. QuestionTwo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement