Post

Replies

Boosts

Views

Activity

Reply to Roll right roll left swift playgrounds
func doIt() {   if isOnClosedSwitch {     toggleSwitch()   }   if isOnGem {     collectGem()   } } func nav() {   doIt()   if isBlockedLeft && isBlocked {     turnRight()   }   else if isBlocked && isBlockedRight {     turnLeft()   }   else if isOnOpenSwitch && isBlocked {     turnLeft()   }   moveForward() } while !isOnOpenSwitch{   nav() }
Mar ’22