Skip to content

Instantly share code, notes, and snippets.

@a1ip
Last active January 16, 2023 14:09
Show Gist options
  • Save a1ip/ae75bcf06fd0085e0523932971b56e91 to your computer and use it in GitHub Desktop.
Save a1ip/ae75bcf06fd0085e0523932971b56e91 to your computer and use it in GitHub Desktop.
Решения для обучающей игры Blockly «Лабиринт» https://git.io/blockly-maze Остальные игры: https://git.io/blockly

Blockly Games logo

Лого игры Blockly «Лабиринт»

moveForward();
moveForward();

moveForward();
turnLeft();
moveForward();
turnRight();
moveForward();

while (notDone()) {
  moveForward();
}

while (notDone()) {
  moveForward();
  turnLeft();
  moveForward();
  turnRight();
}

moveForward();
moveForward();
turnLeft();
while (notDone()) {
  moveForward();
}

while (notDone()) {
  moveForward();
  if (isPathLeft()) {
    turnLeft();
  }
}

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

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

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

while (notDone()) {
  if (isPathRight()) {
    if (isPathLeft()) {
      if (isPathForward()) {
        turnRight();
      } else {
        turnLeft();
      }
    } else {
      turnRight();
    }
  } else {
    if (isPathLeft()) {
      turnLeft();
    } else {
    }
  }
  moveForward();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment