Fork me on GitHub

Jonathan's New Turtlehack

by Jonathan Pulliza

11 Oct 2013

This turtle script will make a random number of polygons with between 5 to 10 sides.

new turtlehack

import turtle
from turtlehack import *
import random

qrt = turtle.Turtle()

for i in range(random.randint(0,50)):
  qrt.color(random_color())
  n_sided_polygon(qrt, random.randint(5,10), random_color())
  random_location(qrt,50,100)

turtle.done()
MSIS student. Loves cooking, modular programming and LEGOs. Find Jonathan Pulliza on Twitter, Github, and on the web.
comments powered by Disqus