Skip to content

Instantly share code, notes, and snippets.

@bvancil
Created June 30, 2020 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvancil/53fed117ba0e36f5716dcd279abcbc72 to your computer and use it in GitHub Desktop.
Save bvancil/53fed117ba0e36f5716dcd279abcbc72 to your computer and use it in GitHub Desktop.
Python code to try on trinket.io to draw spiralaterals
import turtle
def draw_list(tortuga, ns, step = 30, angle = 90):
tortuga.home()
while True:
for n in ns:
tortuga.forward(n * step)
tortuga.right(angle)
if tortuga.position() == (0, 0):
break
tommy = turtle.Turtle()
tommy.shape("turtle")
tommy.speed(500)
draw_list(tommy, [5, 7, 9], step = 10, angle = 135)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment