Advertisement
jabela

RandomDots

Oct 16th, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import turtle
  2. import random
  3.  
  4. def draw_star():
  5.     turtle.penup()
  6.    
  7.     x=random.randint(-200,200)
  8.     y=random.randint(-200,200)
  9.     turtle.goto(x,y)
  10.    
  11.     turtle.colormode(255)
  12.     r=random.randint(0,255)
  13.     g=random.randint(0,255)
  14.     b=random.randint(0,255)
  15.     turtle.color(r, g, b)
  16.    
  17.     sz=random.randint(0,10)
  18.     turtle.dot(sz)
  19.  
  20. turtle.speed(0)
  21. for i in range(50):
  22.     draw_star()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement