Advertisement
DorStopepee

Untitled

Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import turtle
  2. import random
  3. num = 1
  4. w = turtle.Screen()
  5. turtle.st()
  6.  
  7. def do_something(turtle, x,y):
  8.   r = random.randint(0, 255)
  9.   g = random.randint(0, 255)
  10.   b = random.randint(0, 255)
  11.   turtle.color((r,g,b))
  12.   turtle.goto(x,y)
  13. def sizing():
  14.   global num
  15.   num+=1
  16.   turtle.pensize(num % 8)
  17. w.onclick(do_something)
  18. w.onkey(sizing, 's')
  19. w.listen()
  20. w.mainloop()
  21.  
  22.  
  23.  
  24. tommy = turtle.Turtle()
  25. tommy.shape("turtle")
  26. tommy.speed(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement