Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global a=[],b=[];function c(){var f=getCell(),h=push;h(a,f);while(a!==[]){var d=shift(a),x=getCellX(d),
- y=getCellY(d),l=getCellFromXY,z=inArray,e=[l(x+1,y),l(x-1,y),l(x,y+1),l(x,y-1)];h(b,d);for(var g in e){
- if(null==g or isObstacle(g))continue;if(z(b,g))continue;if(!z(a, g)){h(a, g);}}}}c();mark(b,COLOR_RED);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement