Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_neighbour(cell){
- var x = getCellX(cell) ;
- var y = getCellY(cell) ;
- var neighbours = [] ;
- for(var i=-1;i<1;i+=2){
- for(var j=-1;j<1;i+=2){
- if(abs(x+i)+abs(y+1) <= 17){
- var sub_cell = getCellFromXY(x+i, y+j) ;
- if(!isObstacle(sub_cell)
- or !isLeek(sub_cell)){
- push(neighbours, sub_cell) ;
- }
- }
- }
- }
- return neighbours ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement