Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1.     public boolean existeChemin(int iX, int iY)
  2.     {
  3.         if(this.getValue(iX, iY) != 0)
  4.         {
  5.             return false;
  6.         }
  7.         else if(this.getSortie().getX() == iX && this.getSortie().getY() == iY)
  8.             return true;
  9.         else
  10.         {
  11.             this.setValue(iX, iY, 2);
  12.             if(existeChemin(iX + 1, iY))
  13.                 return true;
  14.             if(existeChemin(iX - 1, iY))
  15.                 return true;
  16.             if(existeChemin(iX, iY + 1))
  17.                 return true;
  18.             if(existeChemin(iX, iY - 1))
  19.                 return true;
  20.             return false;
  21.         }
  22.  
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement