Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tower_x = []
- tower_y = []
- def setup ():
- global tower_x
- global tower_y
- size (500, 500)
- background (32, 77, 15)
- calc()
- def calc():
- while len(tower_x) <3:
- x = random (0, 500)
- y = random (0, 500)
- #dist something <=120 (centers of gray circles must be 120 pixels away from each other)
- tower_x.append(x)
- tower_y.append(y)
- validate();
- def validate():
- for i in range (2) :
- delay(100)
- if dist(tower_x[i], tower_y[i], tower_x[i+1], tower_y[i+1]) < 120:
- calc();
- println("test");
- else:
- background (32, 77, 15)
- for i in range (len(tower_x)):
- fill (255, 255, 0)
- ellipse (tower_x[i], tower_y[i], 240, 240)
- fill (150)
- ellipse (tower_x[i], tower_y[i], 30, 30)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement