Blockly Games - Maze - Level 10

preview_player
Показать описание
bmaze, maze
Рекомендации по теме
Комментарии
Автор

thanks for helping me solve this thing cuz I only have 4 brain cells

lengkuas
Автор

Comparatively the most efficient code for Level 10 (Only 15 lines of code)

moveForward();
moveForward();
turnLeft();
while (notDone()) {
if(isPathRight()) {
turnRight();
moveForward();
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnLeft();
}
}
}

mahadishishir
Автор

anyways i did the exact same thing and my guy got stuck trying to move left

manlyguy-mhcc
Автор

One Month Later Still Useful (I played this 1 month ago : October)

shivi
Автор

this is the code:


moveForward();
moveForward();
turnLeft();
moveForward();
while (notDone()) {
if (isPathLeft()) {
turnLeft();
}
if (isPathForward()) {
moveForward();
} else {
turnRight();
}
}

warriorcatz
Автор

What do you think of this solution?

while (notDone()) {
if (isPathForward()) {
moveForward();
}
if (isPathRight()) {
turnRight();
moveForward();
if (isPathLeft()) {
turnLeft();
moveForward();
}
} else {
turnLeft();
}
}

cesaralexandreoliveira
Автор

this is more easy and fast try it


while (notDone()) {
if (isPathRight()) {
if (isPathForward()) {
turnRight();
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnRight();
}
}

Totaa.derasa
Автор

more easy and fastly try it



while (notDone()) {
if (isPathRight()) {
if (isPathForward()) {
turnRight();
} else {
if (isPathLeft()) {
turnLeft();
} else {
turnRight();
}
}

Totaa.derasa