Skip to content

Instantly share code, notes, and snippets.

@OliverUv
Created August 15, 2012 00:58
Show Gist options
  • Save OliverUv/3354395 to your computer and use it in GitHub Desktop.
Save OliverUv/3354395 to your computer and use it in GitHub Desktop.
# assumes:
# X >= Y >= Z (will work otherwise, but suboptimally)
turn_switch = False
def switch():
if turn_switch:
turn_switch = False
else:
turn_switch = True
def dig_line():
for i in range(x): # Do z times
dig
move forward
def dig_layer():
for i in range(y):
dig_line()
if turn_switch:
turn left
move forward
turn left
switch()
else:
turn right
move forward
turn right
switch()
def dig_rectangle():
for i in range(z):
dig_layer()
move down
turn right
turn right
switch()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment