daily pastebin goal
39%
SHARE
TWEET

Untitled

DorStopepee Apr 20th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top