Guest User

Untitled

a guest
Jan 7th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global Voisins = [] ;
  2. for (var i = 0; i < 613 ; i++) {
  3. Voisins[i] = [] ;
  4. if (getCellFromXY(getCellX(i) + 1, getCellY(i)) and isEmptyCell(getCellFromXY(getCellX(i) + 1, getCellY(i)))){
  5.     push (Voisins[i], getCellFromXY(getCellX(i) + 1, getCellY(i))) ;   
  6.  
  7. }
  8. if (getCellFromXY(getCellX(i) - 1, getCellY(i)) and isEmptyCell(getCellFromXY(getCellX(i) - 1, getCellY(i)))){
  9.         push (Voisins[i], getCellFromXY(getCellX(i) - 1, getCellY(i))) ;
  10.        
  11. }
  12. if (getCellFromXY(getCellX(i) , getCellY(i)+ 1) and isEmptyCell(getCellFromXY(getCellX(i) , getCellY(i)+ 1))) {
  13.             push (Voisins[i], getCellFromXY(getCellX(i) , getCellY(i)+ 1)) ;
  14.            
  15. }
  16. if (getCellFromXY(getCellX(i) , getCellY(i)- 1) and isEmptyCell(getCellFromXY(getCellX(i) , getCellY(i)- 1))) {
  17.                 push (Voisins[i], getCellFromXY(getCellX(i) , getCellY(i)- 1)) ;
  18.            
  19. }  
  20. }
  21. //debug(Voisins) ;
  22. var cell1 = [getCell()] ;
  23. debug(cell1) ;
  24. global cell2 = [] ;
  25. var casesAccessibles = [] ;
  26. var casesACote = Voisins[getCell()] ;
  27. var casesATester = [] ;
  28.  
  29. //for (var pm = getMP(); pm ==! 0 ; pm--) {
  30. for (var izzy = 0; izzy < count(cell1); izzy++) {
  31.     pushAll(casesAccessibles, Voisins[cell1]) ;
  32.     pushAll(cell2, Voisins[cell1]) ;
  33.     mark(casesAccessibles, COLOR_BLUE) ;
  34.     cell1 = cell2;
  35.     debug(cell2) ;
  36.     cell2 = [] ;
  37.     debug(cell1) ;
  38.     }
  39. //}
Advertisement
Add Comment
Please, Sign In to add comment