Re:Sprite3D.js: a javascript library for 3D positionning
by xnxn on Saturday August 06, 2011 @02:21PM
(#2854513)
Augh! Try not to spend too much time on that slide puzzle :P http://i.imgur.com/za6IN.png
[ Parent
| on HN ]
Re:Sprite3D.js: a javascript library for 3D positionning
by pharrington on Saturday August 06, 2011 @07:38PM
(#2855191)
Well yeah:
// then scramble
var r1, r2;
for( i = 0; i < numpieces>>1; i++ )
{
exchange( Math.random() * numpieces >> 0, Math.random() * numpieces >> 0 );
}
Easily enough fixed by just "manually" sliding a random piece adjacent to the hole a couple thousand or so times, but yeah... Making any sort of game, no matter how simple, is harder than you think :\