3 ms·
Each turn, one 2 tile is added, and other tiles may be combined. So you can derive the move count by adding together the numbers on all the visible tiles and di
by duskwuff 13y ago
Each turn, one 2 tile is added, and other tiles may be combined. So you can derive the move count by adding together the numbers on all the visible tiles and dividing by 2.
- jsmthrowaway 13y agoThis is inaccurate, because you have a 10% chance of getting a 4 tile added instead of a 2. That part makes the game tricky, because otherwise you could optimize every solution like an algorithm without ever losing. var value = Math.random() < 0.9 ? 2 : 4; https://github.com/gabrielecirulli/2048/blob/master/js/game_manager.js#L45 https://github.com/gabrielecirulli/2048/blob/master/js/game_...
- duskwuff 13y agoOh, huh, I didn't even realize it was doing that. Even so, the move count will still be roughly proportional to the sum of the board (plus or minus some random variation), won't it?
- samstave 13y agoThanks Neckbeard, I refuse to do these calculations in my head... The author should do this, and create a counter of moves within the app.
- samstave 13y agoeh... Sorry - I was tipsy when I posted that...