Created
June 30, 2020 21:23
-
-
Save bvancil/53fed117ba0e36f5716dcd279abcbc72 to your computer and use it in GitHub Desktop.
Python code to try on trinket.io to draw spiralaterals
This file contains 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 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