/
GeoExe
/
Maze_Robot
Обзор
Документация
Войти
/
GeoExe
/
Maze_Robot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Mazes/SnakeMazeTask.cs
34 строки
934 B
GeoExe
Files with tasks uploaded
14 окт 2025, 21:18
14 окт 2025, 21:18
0a1ac52
Код
Авторство
О чём код?
namespace Mazes; public static class SnakeMazeTask { public static void MoveOut(Robot robot, int width, int height) { while (!robot.Finished) { MoveRight(robot, width - 3); MoveDown(robot, 2); MoveLeft(robot, width - 3); if (!robot.Finished) MoveDown(robot, 2); } } private static void MoveRight(Robot robot, int steps) { for (var stepRight = 0; (stepRight < steps); stepRight++) robot.MoveTo(Direction.Right); } private static void MoveLeft(Robot robot, int steps) { for (var stepLeft = 0; (stepLeft < steps); stepLeft++) robot.MoveTo(Direction.Left); } private static void MoveDown(Robot robot, int steps) { for (var stepDown = 0; (stepDown < steps); stepDown++) robot.MoveTo(Direction.Down); } }