Created
August 15, 2012 00:58
-
-
Save OliverUv/3354395 to your computer and use it in GitHub Desktop.
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
# 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