Blockly Games : Maze 1
Question 問題:
Solution 解答:
moveForward();
moveForward();
Blockly Games : Maze 2
Question 問題:
Solution 解答:
moveForward();
turnLeft();
moveForward();
turnRight();
moveForward();
Blockly Games : Maze 3
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
}
Blockly Games : Maze 4
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
turnLeft();
moveForward();
turnRight();
}
Blockly Games : Maze 5
Question 問題:
Solution 解答:
moveForward();
moveForward();
turnLeft();
while (notDone()) {
moveForward();
}
Blockly Games : Maze 6
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
if (isPathLeft()) {
turnLeft();
}
}
Blockly Games : Maze 7
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
if (isPathRight()) {
turnRight();
}
}
Blockly Games : Maze 8
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
if (isPathLeft()) {
turnLeft();
}
if (isPathRight()) {
turnRight();
}
}
Blockly Games : Maze 9
Question 問題:
Solution 解答:
while (notDone()) {
if (isPathForward()) {
moveForward();
} else {
turnLeft();
}
}
Blockly Games : Maze 10
Question 問題:
Solution 解答:
while (notDone()) {
moveForward();
if (isPathForward()) {
if (isPathRight()) {
turnRight();
} else {
if (isPathLeft()) {
turnLeft();
} else {
}
}
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnRight();
}
}
}
Comments
Post a Comment