Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Mazes
- {
- public static class PyramidMazeTask
- {
- public static void MoveSide(Robot robot, int step, Direction direction)
- {
- for (int i = 0; i < step; i++)
- robot.MoveTo(direction);
- }
- public static void DoPyramidLoop(Robot robot, int width)
- {
- MoveSide(robot, width, Direction.Right);
- MoveSide(robot, 2, Direction.Up);
- MoveSide(robot, width-2, Direction.Left);
- if (robot.Finished) return;
- MoveSide(robot, 2, Direction.Up);
- DoPyramidLoop(robot, width-4);
- }
- public static void MoveOut(Robot robot, int width, int height)
- {
- while (!robot.Finished)
- DoPyramidLoop(robot, width-3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement