Last active
December 10, 2015 17:38
-
-
Save mlincoln/4469204 to your computer and use it in GitHub Desktop.
really simple script that makes pseudo-random drawings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| import turtle | |
| length = 250 | |
| iterations = 50 | |
| def drawer(): | |
| T=turtle.Turtle() | |
| T.hideturtle() | |
| T.screen.colormode(255) | |
| T.speed(0) | |
| T.up() | |
| T.pensize(2) | |
| T.goto(random.randint(-length,length),random.randint(-length,length)) | |
| T.down() | |
| for x in range(0,iterations): | |
| picker = random.randint(1,3) | |
| if picker == 1: | |
| T.color(random.randint(0,255),random.randint(0,255),random.randint(0,255)) | |
| T.goto(random.randint(-length,length),random.randint(-length,length)) | |
| if picker == 2: | |
| T.color(random.randint(0,255),random.randint(0,255),random.randint(0,255)) | |
| for x in range(0,random.randint(0,90)): | |
| T.left(1) | |
| T.forward(2) | |
| if picker == 3: | |
| T.color(random.randint(0,255),random.randint(0,255),random.randint(0,255)) | |
| for x in range(0,random.randint(0,90)): | |
| T.right(1) | |
| T.forward(2) | |
| drawer() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment