How I Designed My Tambola Game

The Articles goes through the journey to creating a Tambola Game

Number Theory

Tambola, for the unbeknownst, is a game where you get a ticket with a 3x9 grid and if your tickets matches a pattern with the numbers that are called and you are the first to call it out, you win the prize. For examples, A host calls out numbers from a jar and if those numbers are on the first row of your ticket, you can claim the first row and win the prize for it.

Let Me Tell You Something

I was sitting with my cousin and we were discussing the game. Suddenly, a thought came into my head, what about a Tambola PaaS?, What’s a PaaS? Platform as a Service. What does it have to do with Tambola? Tambola is mostly a pen and paper and plastic affair but how about there is a digital way to play Tambola. Will people use it?. Digital India time, my buddy. The idea got my brother intrigued and so I started working on it.

The Crew (Tech Stack)

  • Java: The Backend Afficianado: Java is one of the most reliable backend programming language used by banks, Netflix and many more. So I think it’s more than enough to handle my measly Tambola platform.
  • Spring Boot: The Gun: Java paired with Spring Boot becomes a beast to be reckoned with. It abstracts the boiler plate code and packs in all the stuff you need to quickly build the skeleton which would’ve taken you weeks to build in a day or two.
  • React: The Greeter: React, a framework which I have very few words for because I’m not a frontend developer. What I can say is, it has an amazing ecosystem of people building plugins for it and a large developer community.
  • MongoDB: The Supplier: Scalable and flexible NoSQL database with no fixed schema. Perfect for managing users and games.

And together, I call this, the MJRS Stack (pronounced Majors)

Time to build

The first thing to build is an algorithm to generate Tambola tickets because they have a set pattern that you have to follow and I haven’t found an algorithm on the internet to help me generate it. How many possible tickets can you generate?

3,669,688,706,217,187,500

or roughly 3.67 quadrillion

So, I decided to write the algorithm myself. Writing Algorithm

So what do we have, a 3x9 grid. No column can have more than two numbers and no row can have more than five. I sat down with my notebook and drew the grid, then found methods on how to populate them. After lots of trials and errors, at 2 in the morning I finally finished the algorithm.

Tambola Image

Algorithm Explained

Step 1: Choose 15 grid positions
  • Pick one cell from every one of the 9 columns.
  • After the picking, if a column has 2 cells picked or a row has 5 cells picked, remove that row or column from consideration.
  • Then pick 6 more cells from the remaining.
Step 2: Assign a number to each position
  • For every column, choose random numbers belonging to its range like Col 1 -> 1-9.
  • Remove the number from consideration pool.

It sounds simple but took me a substantial amount of time to get it down.

Tambola Image

Other Things that I have added

The ticket generator no matter how impressive it is,(self-gloating alert) is not enough for the game. So here are the other things I made.

  • A Login Page: Two ways an user can login as, a player or a host.
  • Host Dashboard: With this page, The host can create games or manage users in their games.
  • Bingo Board: Where the host can call numbers and check for claims.

Deployment

After all things are said and done, its time to deploy. I chose a spare Mac Mini to deploy the game and a domain to serve it to every one.

Learnings

  • I finished this back in September 2025 and this was my first app that I have built end to end. I learnt a large deal of system design.
  • I have sold the Mac M2, so when I need to actually deploy for people to play I need something like Railway to deploy the game in cloud.

Recent Posts