Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. namespace Mazes
  2. {
  3.     public static class EmptyMazeTask
  4.     {
  5.         public static void MoveOut(Robot robot, int width, int height)
  6.         {
  7.             int x = 1;
  8.             int y = 1;
  9.  
  10.             go_bottom(y, height, robot);
  11.             go_right(x, width, robot);
  12.         }
  13.  
  14.         static void go_bottom(int y, int height, Robot bot)
  15.         {
  16.             while(y != height - 2)
  17.             {
  18.                 bot.MoveTo(Direction.Down);
  19.                 y++;
  20.             }
  21.         }
  22.         static void go_right(int x, int width, Robot bot)
  23.         {
  24.             while(x != width - 2)
  25.             {
  26.                 bot.MoveTo(Direction.Right);
  27.                 x++;
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement