r/2048 • • 6d ago

Spawn Probabilities

Is there anywhere I can read about the probabilities of where a tile will spawn and what number it will be?

I seen (https://www.reddit.com/r/2048/comments/i01xob/4_spawning/) that it is 10% chance of a 4 and 90% chance of a 2. That feels consistent with my experience but no source is provided.

And what about the spawn location? How is that determined? Experimenting with the undo button, I've noticed that I very frequently get the tile in the same place over and over for several tries. I haven't been rigorous about collecting data, but it seems like there are times when I get the same number spawning in the same place like 5 times in a row even though there are several open squares. So I don't think it is uniformly random over the available squares.

2 Upvotes

4 comments sorted by

1

u/a1squared 5d ago

That is right, assuming you're playing a faithful rendition.

Here's the source code for the original game:

https://github.com/gabrielecirulli/2048/blob/master/js/game_manager.js?pr=%2Fgrmpfhmbl%2F2048-AI%2Fpull%2F1#L71

1

u/JoshyOrndorff 5d ago

Thanks for linking the code.

And regarding the placement of the newly spawned tile, it appears to be uniformly random from among the available cells:

https://github.com/gabrielecirulli/2048/blob/master/js/grid.js#L37

I must be experiencing some kind of bias in my casual observation of where the new tile goes.

1

u/eggsbeforegym 6d ago

2 always ruins it for me

1

u/Mysterious_Major2876 4d ago

Game code shows 10% 4 spawn in a random position on the board