Better HN
topnewbestaskshowjobs
Log inSign up

codybits

72 karma · joined Apr 23, 2014 (12y ago) · 4 submissions

Submissions

comment 10y ago · link · parent

I've been using OpenJSCAD (demo at http://openjscad.org/) for small parts and really like it. With some work it could probably do what you describe but as far as I can tell no one is using it that way.

It would be cool if there was an ecosystem of OpenJSCAD parts that you could import as javascript modules.

comment 10y ago · link · parent

The song is Windowdipper by Jib Kidder

comment 11y ago · link · parent

Yeah, that would probably help a lot. It is pretty dumb in its current state. That said, sometimes it can join matching tiles that are next to each other in the bottom of the pile, so that can still be useful.

Maybe I'll work on it some later...

comment 11y ago · link · parent

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/842149b82ed363659678

The highest I've seen it manage is 17.