|
I was wondering how a quick random player might fare so I made a simple one. Paste this into your inspector console (or in chrome type "javascript:" into the URL bar and paste it): function countPieces(){it=b.pieces();for(var e=0;it.current();)e++,it.next();return e}function getRandPiece(){for(var e=b.pieces(),t=Math.floor(Math.random()*countPieces()),n=0;t>n;n++)e.next();return e.current()}function stackRandPiece(){if(!b.isBusy()){if(b.isGameOver())return void clearInterval(randInterval);var e=getRandPiece();b.setTarget({x:e.pos.x+100,y:1500}),b.grab(e),window.setTimeout(function(){b.setTarget({x:200*Math.floor(7*Math.random())+100,y:1500}),window.setTimeout(function(){b.release()},15)},15)}}randInterval=window.setInterval(stackRandPiece,40);
Original code here: https://gist.github.com/CodyWalker/842149b82ed363659678The highest I've seen it manage is 17. |
Basically same, but giving weight left<>right based on the value of the number.
EDIT: Oooh... just discovered, 20 x 2 is a thing... go twentybot!