How a Tombala Card Is Generated: Six Cards, Ninety Numbers
By Nesim Razon, independent Android developer · 2026-11-12
A Tombala card looks simple, but a fair set of cards has strict rules. While building Tombalings I wrote a generator that makes six cards using every number from 1 to 90 exactly once. Here is how it works, and how the rival players are timed so a round feels alive.
The rules a card must follow
A Tombala card has 3 rows and 9 columns with 15 numbers. Each row holds exactly 5 numbers. Each column holds only numbers from its own range: 1 to 9 in the first column, 10 to 19 in the second, and so on, with 80 to 90 in the last. And every column holds between one and three numbers.
Those rules alone are easy. The hard part is a set of six cards: together they must contain every number from 1 to 90 once, no repeats and no gaps.
Why the numbers add up
Look at the columns. The first column has 9 possible numbers, the middle columns have 10 each and the last has 11. Across six cards, every column must be used by every card at least once, so each card starts with one number per column. That already uses 9 numbers of its 15.
What is left over are the extra numbers: 3 in the first column, 4 in each of the seven middle columns and 5 in the last. Each card needs exactly 6 extras to reach its 15. The totals match, so a solution exists, but the extras still have to be shared out so that no card gets more than three numbers in one column.
Step one: how many numbers per column
The generator first decides, for every card and every column, how many numbers it holds: one, two or three. It deals the extras column by column, favouring the cards that still need the most, with a little randomness. If it ever gets stuck, it throws the attempt away and starts again. Retrying is cheap, and it keeps the code short and the result unbiased.
Step two: where the numbers sit
Next it chooses which cells in the card are filled. Each row must end with 5 numbers, and each column must have the right count. The generator places the busiest columns first, putting each number into the rows that are emptiest so far. When the rows all reach 5, the card layout is valid. If not, it tries a different arrangement.
Step three: filling in the numbers
Finally, for each column the numbers of that range are shuffled and dealt out to the six cards by the counts chosen in step one. Inside a card the numbers of a column are sorted from small to large, top to bottom, the way printed cards look. The seed of the random generator decides everything, so the same seed always produces the same set. That is useful for testing.
Making the rivals feel human
The rivals mark every drawn number instantly, but they do not call instantly. When a rival qualifies for a prize, the game waits a reaction time first. Each rival gets its own base reaction between about 0.7 and 2.5 seconds, scaled by the difficulty you choose (faster for sharp rivals, slower for relaxed ones) plus a small random extra. A rival also holds one card, or two about a third of the time.
The auto-call option for the player waits a short, human-like delay too, between 0.6 and 0.9 seconds. Without it, the player would win every tie, which would feel unfair and boring.
Testing it
Because the game advances with a fixed time step and a seed, a whole round can be replayed in a unit test in milliseconds. The tests check that every strip has exactly 90 distinct numbers, that every card has 15 numbers with 5 per row and that column ranges are respected, over many seeds. It is a good reminder that small rules deserve automatic checks.
Frequently asked questions
How many numbers are on a Tombala card?
Fifteen: five in each of the three rows, spread across nine columns.
What is a strip of six cards?
Six cards that together contain every number from 1 to 90 exactly once.
Do the rivals react instantly?
No. They mark instantly but wait a short reaction time before calling, which depends on the difficulty you choose.
Is the draw order random?
Yes. The numbers 1 to 90 are shuffled and drawn once each.
More from the blog
How We Guarantee a Mahjong Solitaire Board Is Solvable
Mahjong Solitaire History and How It Differs From Mahjong- How a Daily Puzzle Can Be the Same for Everyone, No Server
- How Hundreds of Puzzle Levels Are Generated and Checked
- Tic-Tac-Toe: A Solved Game, an Early Computer and Its Variants
- Earthquake Magnitude vs Intensity: What Is the Difference?