論理の迷宮@コードを学ぼう1
//論理の迷宮@コードを学ぼう1 for i in 1 ... 8 { moveForward() if isOnGem && isOnClosedSwitch { turnRight() moveForward() moveForward() collectGem() turnLeft() turnLeft() moveForward() moveForward() turnRight() toggleSwitch() collectGem() } if isOnClosedSwitch || isOnGem { collectGem() toggleSwitch() } if isBlocked || !isBlockedLeft { turnLeft() } }