Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean existeChemin(int iX, int iY)
- {
- if(this.getValue(iX, iY) != 0)
- {
- return false;
- }
- else if(this.getSortie().getX() == iX && this.getSortie().getY() == iY)
- return true;
- else
- {
- this.setValue(iX, iY, 2);
- if(existeChemin(iX + 1, iY))
- return true;
- if(existeChemin(iX - 1, iY))
- return true;
- if(existeChemin(iX, iY + 1))
- return true;
- if(existeChemin(iX, iY - 1))
- return true;
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement