Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Algorithm for a 2D shape
- from turtle import *
- from random import randint
- def random_area():
- penup()
- x = randint(-100, 100)
- y = randint(-100, 100)
- goto(x,y)
- pendown()
- def randomColor():
- red = (randint(0,255))
- green = (randint(0,255))
- blue = (randint(0,255))
- color(red, green, blue)
- def surprise(length, height):
- random_area()
- randomColor()
- begin_fill()
- forward(length)
- right(60)
- forward(height)
- right(60)
- forward(length)
- right(60)
- forward(height)
- right(60)
- forward(length)
- right(60)
- forward(height)
- right(60)
- end_fill()
- surprise(50, 50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement