Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Augh! Try not to spend too much time on that slide puzzle :P http://i.imgur.com/za6IN.png


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 :\




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: