Tässä koodit niihin ongelmiin,
joista ne piti tänne laittaa:
13
while (notFinished()) {
turnRight();
moveForward();
turnLeft();
moveForward();
}
16
while (notFinished()) {
moveForward();
if (isPathLeft()) {
turnLeft();
}
}
18
while (notFinished()) {
if (isPathForward()) {
moveForward();
} else {
turnLeft();
}
}
20
while (notFinished()) {
if (isPathForward()) {
moveForward();
} else {
if (isPathRight()) {
turnRight();
} else {
turnLeft();
}
}
}
Ois ihan kiva kokeilla ihan oikeetakin koodausta joskus :)
Ei kommentteja:
Lähetä kommentti