Skip to content

Instantly share code, notes, and snippets.

@Guevarak1
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save Guevarak1/8824b74ba97e62d50caa to your computer and use it in GitHub Desktop.

Select an option

Save Guevarak1/8824b74ba97e62d50caa to your computer and use it in GitHub Desktop.
#highest input should be 5 for testing
def recursion(level):
#accomidate for input params for move and turn
level = level/10
#set these to level
moveLev = level
turnAng = level
#if level is 1 then just do the small part of recursion
if level <= 1:
move(1,.1)
turn(1,.1)
#else start from the input level, move that length turn that angle and call recursion again with input level-1
#should repeat until we get to basecase.
else:
move(1,moveLen)
turn(1,turnAng)
#this should show that it turns those angles. for debugging only
wait(5)
recursion(level-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment