Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

``Lisp has too many parens''

Name: Anonymous 2018-11-09 9:59

Said the js developer as he typed ``})();})($);'' to finish his javashit module. ``So clear!'', he asserted satisfied.

Name: Anonymous 2018-11-10 14:48

>>11,12,13
False, you can early return/goto without braces. Here is example from my slither "AI"
function food(){
if(!foodsearch)return;
if(!unsafeWindow.snake)return;
if(!unsafeWindow.foods)return;
if(unsafeWindow.foods.length<2)return;
var snakeid="s"+unsafeWindow.snake.id;

// var i=(Math.random()*unsafeWindow.foods.length)|0;
/// if(!unsafeWindow.foods[i])return;


var i,best,best,bestdist=1e12,curdist,found=false;
var sn1=unsafeWindow.os[snakeid].xx,sn2=unsafeWindow.os[snakeid].yy,fn1,fn2;

for(i=0;i<unsafeWindow.foods.length;i++){

if(!unsafeWindow.foods[i])continue;
// document.title="HAS_CHANCK"
if(unsafeWindow.foods[i].eaten)continue;
// document.title="HASFOOD"
fn1= unsafeWindow.foods[i].xx;
fn2=unsafeWindow.foods[i].yy;

curdist=dist(sn1,sn2,fn1,fn2);
if(curdist>max_feed_dist){;continue;}

//document.title=curdist
if(curdist<bestdist){bestdist=curdist;best=i;found=true;}
}
//document.title="foodFound"+unsafeWindow.foods[best].xx+":"+unsafeWindow.foods[best].yy;
//var angle= unsafeWindow.foods[best].gfw2;
var xbonus=sn1>fn1?-feed_approach:feed_approach;
var ybonus=sn2>fn2?-feed_approach:feed_approach;
if(!found){forcerandsnake();return;}


document.title="Found:"+best;
unsafeWindow.os[snakeid].xx= unsafeWindow.foods[best].xx+xbonus;
unsafeWindow.os[snakeid].yy= unsafeWindow.foods[best].yy+ybonus;

}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List