Created
December 13, 2018 06:00
-
-
Save KolemanIreland/5ebd9a8e5b1fecfc5f736d68d584904d to your computer and use it in GitHub Desktop.
Which Way to Turn Swift Playgrounds Learn to Code 1
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
while isBlockedRight{ //while blocked on the right move forward. | |
moveForward() | |
if isOnClosedSwitch && !isBlocked{ //while moving forward, if lands on a closed switch and is NOT blocked.. | |
toggleSwitch() // flip the switch... | |
turnRight() //turn right... | |
moveForward() //move forward... | |
} | |
while isBlocked{ //until you're blocked from the front and... | |
turnLeft() | |
if isOnClosedSwitch{ | |
toggleSwitch() | |
} //gotta get the gem somehow. | |
} | |
while isOnGem{ //got the gem. | |
collectGem() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment