Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1.         private int recSolve(Point pos)
  2.         {
  3.             if (blockState[pos.Y, pos.X] == mazeblock.Target)
  4.             {
  5.                 return 1;
  6.             }
  7.  
  8.             newDirections = new List<Point>();
  9.  
  10.             possibleDirections(pos);
  11.  
  12.             blockState[pos.Y, pos.X] = mazeblock.Visited;
  13.  
  14.             canvas.SetBBScaledPixel(pos.X, pos.Y, Color.Purple);
  15.  
  16.             Thread.Sleep(20);
  17.            
  18.             if(newDirections.Count > 0)
  19.             {
  20.                 foreach(Point p in newDirections)
  21.                 {
  22.                     recSolve(p);
  23.                 }
  24.             }
  25.             else
  26.             {
  27.                 canvas.SetBBScaledPixel(pos.X, pos.Y, Color.LightGreen);
  28.             }
  29.             return 1;
  30.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement