Show HN: Twenty
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 <i>type</i> "javascript:" into the URL bar and paste it):<p><pre><code>  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);
</code></pre>
Original code here: <a href="https://gist.github.com/CodyWalker/842149b82ed363659678" rel="nofollow">https://gist.github.com/CodyWalker/842149b82ed363659678</a><p>The highest I've seen it manage is 17.