//値が等しいかどうかを調べる@コードを学ぼう2 let switchCounter = numberOfSwitches var j = 0 while j != switchCounter { while !isBlocked { moveForward() if isOnGem { collectGem() j += 1 } } turnRight() }
//値が等しいかどうかを調べる@コードを学ぼう2 let switchCounter = numberOfSwitches var j = 0 while j != switchCounter { while !isBlocked { moveForward() if isOnGem { collectGem() j += 1 } } turnRight() }