3つの分かれ道@コードを学ぼう1
//3つの分かれ道@コードを学ぼう1 //2歩進んで右に曲がる func step2() { moveForward() moveForward() turnRight() } //7歩進む func step7() { moveForward() moveForward() moveForward() moveForward() moveForward() moveForward() moveForward() } for i in 1 ... 3 { step2() step7() toggleSwitch() turnLeft() turnLeft() step7() turnRight() }