Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global Voisins = [] ;
- for (var i = 0; i < 613 ; i++) {
- Voisins[i] = [] ;
- if (getCellFromXY(getCellX(i) + 1, getCellY(i)) and isEmptyCell(getCellFromXY(getCellX(i) + 1, getCellY(i)))){
- push (Voisins[i], getCellFromXY(getCellX(i) + 1, getCellY(i))) ;
- }
- if (getCellFromXY(getCellX(i) - 1, getCellY(i)) and isEmptyCell(getCellFromXY(getCellX(i) - 1, getCellY(i)))){
- push (Voisins[i], getCellFromXY(getCellX(i) - 1, getCellY(i))) ;
- }
- if (getCellFromXY(getCellX(i) , getCellY(i)+ 1) and isEmptyCell(getCellFromXY(getCellX(i) , getCellY(i)+ 1))) {
- push (Voisins[i], getCellFromXY(getCellX(i) , getCellY(i)+ 1)) ;
- }
- if (getCellFromXY(getCellX(i) , getCellY(i)- 1) and isEmptyCell(getCellFromXY(getCellX(i) , getCellY(i)- 1))) {
- push (Voisins[i], getCellFromXY(getCellX(i) , getCellY(i)- 1)) ;
- }
- }
- //debug(Voisins) ;
- var cell1 = [getCell()] ;
- debug(cell1) ;
- global cell2 = [] ;
- var casesAccessibles = [] ;
- var casesACote = Voisins[getCell()] ;
- var casesATester = [] ;
- //for (var pm = getMP(); pm ==! 0 ; pm--) {
- for (var izzy = 0; izzy < count(cell1); izzy++) {
- pushAll(casesAccessibles, Voisins[cell1]) ;
- pushAll(cell2, Voisins[cell1]) ;
- mark(casesAccessibles, COLOR_BLUE) ;
- cell1 = cell2;
- debug(cell2) ;
- cell2 = [] ;
- debug(cell1) ;
- }
- //}
Advertisement
Add Comment
Please, Sign In to add comment