Advertisement
Guest User

Tortuga telemaco103

a guest
Jul 31st, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. import turtle as t
  2. import random
  3.  
  4. tim = t.Turtle()
  5. t.colormode(255)
  6.  
  7. color_list = [(4, 31, 91), (66, 11, 35), (201, 182, 10), (221, 67, 11), (204, 12, 55), (3, 67, 14), (246, 77, 15),
  8.               (208, 211, 7), (227, 49, 97), (5, 97, 17), (182, 45, 81), (210, 134, 150), (236, 195, 200),
  9.               (149, 163, 183), (199, 216, 196), (73, 92, 125), (238, 165, 175), (145, 181, 142), (220, 181, 170),
  10.               (58, 117, 62), (21, 53, 115), (177, 205, 168), (253, 3, 80), (166, 30, 5), (93, 150, 96), (106, 124, 158)]
  11.  
  12.  
  13.  
  14. tim.hideturtle()
  15. tim.penup()
  16.  
  17. # Parameters
  18. Rows = 11
  19. Columns = 10
  20. Pos_x_init = -250.00
  21. Pos_y_init = -200.00
  22. x_step = 50.00
  23. y_step = 50.00
  24.  
  25.  
  26. for row in range(Rows):
  27.     tim.setposition(Pos_x_init, Pos_y_init + y_step*row)
  28.     for column in range(Columns):
  29.         tim.speed(0)
  30.         tim.dot(20,random.choice(color_list))
  31.         tim.forward(x_step)
  32.    
  33.  
  34. tim.hideturtle()
  35. screen = t.Screen()
  36. screen.exitonclick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement