func checkTile(){
if isOnGem {
collectGem()
}
if isOnClosedSwitch {
toggleSwitch()
}
}
func nav() {
if isBlocked && isBlockedRight{
turnLeft()
}
if isBlocked && isOnClosedSwitch {
turnLeft()
}
if isBlocked {
turnRight()
}
if isOnClosedSwitch && isBlocked {
toggleSwitch()
}
}
while !isOnOpenSwitch {
nav()
checkTile()
moveForward()
}