What is 7-bag? How piece order works
How the 7-bag randomizer guarantees every piece once per cycle, and how to use that for look-ahead.
In modern falling-block puzzle games the order of pieces is not fully random. The randomizer used by most competitive rule sets is called 7-bag. Understanding it makes your predictions about upcoming pieces far more accurate, and it is the foundation for look-ahead techniques such as perfect-clear stacking.
How 7-bag works
All seven tetrominoes (I, O, T, S, Z, J, L) are put into a bag and drawn one at a time in random order. When the bag is empty it is refilled with all seven again. In other words, every group of seven consecutive pieces (one cycle) contains each piece exactly once.
Some direct consequences:
- The same piece never appears twice within one cycle.
- The same piece can come back immediately (last of one bag, first of the next), or with as many as 12 other pieces in between (first of one bag, last of the next).
- Once you know which pieces have appeared, you know what is left in the bag (by elimination).
Using it for look-ahead
The preview usually shows the next five pieces. With 7-bag you can also count how many pieces of the current bag are still unseen, which narrows down what comes after the preview.
Here pieces six and seven are guaranteed to be Z and I in some order. When waiting for an I to score a four-line clear, or when a perfect clear needs one specific piece, you can reason “the I is coming within two pieces for sure”.
Watch the bag boundary
The weak spot of 7-bag is the boundary. The last piece of a bag and the first piece of the next are independent, so the same piece can appear twice in a row (for example S, S). Conversely, a piece that came at the very end of a bag may not return until the end of the next one.
Get into the habit of counting where you are inside the bag. Start simple: just track whether the I has appeared yet in the current cycle.
Relation to perfect clears
A four-line perfect clear is 40 cells, exactly ten pieces. Ten pieces equal one full bag (seven) plus the first three pieces of the next bag, so the goal of the first seven pieces is to leave a shape that the next three pieces can fill. Because of 7-bag those three come from a fresh bag, so you cannot know which they will be. That is why good leftover shapes are the ones that many different piece combinations can complete.