I've been learning from swift playgrounds several times.
I typed the cord as shown in the picture, and it went smoothly to the red jewel, but it didn't stop at the jewel square, so I just passed by.
Is the nesting of while sentences not good?
When !isOngem
is released (when you come to the jewel mass), I would like you to remove the while statement from the outer frame and collectGem, but I will walk straight.
I would appreciate it if you could let me know.
Thank you.
Here are the pre-resolved codes:
func move(){
toggleSwitch()
if isBlocked {
turnLeft()
} else if!isBlockedRight{
turnRight()
}
}
while!isOnGem{
while!isOnClosedSwitch{
moveForward()
}
move()
}
collectGem()
Based on the advice Nekketsuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
Thank you!
func move(){
moveForward()
if isOnClosedSwitch {
toggleSwitch()
}
if isBlocked {
turnLeft()
}
if!isBlockedRight{
turnRight()
}
}
while!isOnGem{
move()
}
collectGem()
Tip: !isOnClosedSwitch
is stuck in the inner while loop until it is satisfied and is not checked for isOnGem
.
610 Uncaught (inpromise) Error on Electron: An object could not be cloned
577 PHP ssh2_scp_send fails to send files as intended
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
887 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.