Hi, I’m a swift beginner and started to learn Swift with Swift playground. I can’t solve Land of Bounty using while loop. What I wrote works well until the Byte gets at the beginning of the third row in front of the first switch and then it gets stuck, I can’t figure out why. Could anybody tell me what I do wrong, please?
Thanks a lot
while !isBlocked && !isBlockedRight {
moveForward ()
if isOnClosedSwitch {
toggleSwitch ()
} else if isOnGem {
collectGem
}
if isBlocked && isBlockedLeft
turnRight ()
moveForward ()
turnRight ()
}
if isBlocked {
turnLeft ()
moveForward ()
turnLeft ()
}
}