Jebot, a Traditional Indonesian Game
By: Richard Russell
Tags: JavaScript, Indonesia, Programming, Python, Coding

Summer vacation is finally here, which means that I can focus my time on important matters such as making things and honing my skills as a programmer.

Today, I will be building jebot. I, and probably all Indonesians in this world, would probably remember jebot. It is a game usually played from elementary school all the way to university. During times when the bus is taking a long time to come, or when the conversation is dead, people would turn to jebot to entertain themselves.

I first had an idea to make jebot around the last days of October 2018. During that time, I was on my way to a village in Kuningan. I was having a community service act called live in, where students live and be part of the lives of farmers. It’s really interesting in all honesty.

The bus ride, though, was not interesting. It was a daunting 13 hour ride from Jakarta. Add that with the fact that smartphones were not allowed, no one brought playing cards, books or any entertainment media. The only thing we did was talk and hope for new conversation topics to come up. A few hours in, everybody started feeling bored. That was when everyone started to play jebot. Think about it, a full bus playing together. The possible answers were endless!

So, what is jebot? Basically, it is a game played between two players. Each player would start with two thumbs (of course), meaning that there are currently 4 total thumbs in the “battlefield”. Once the game starts — after picking who goes first beforehand — the first player (we shall call him player A) gets to shout out a number between 0 to 4 (or the amount of thumbs left in the “battlefield”). At the same time, both players would bring their thumb/thumbs up. If the amount of thumbs up is equal to the number shouted by player A, then player A would win that round and he gets to put his hand down, thus reducing the total thumb amount to 3.

Here, the player in the bottom left guessed correctly, meaning that he gets to put his hand down.

In the midst of playing, I thought to myself that this game is somewhat logical. The steps were clear and simple enough that a computer could probably play too, given the right parameters. So, after losing in the 3rd turn, I turned back to my seat and start brainstorming.

With me, I brought a stack of papers. Wherever I go, I would always try to bring a paper and pen. Inspiration could come at anytime. With those stack of papers, I brainstormed and figured out the logic behind the game.

I started off from the beginning of the game. What happens at the beginning of the game? Who gets to go first? What is the first move? I asked myself those questions so that I could have at least a guideline of what to write and what to think about, instead of just randomly writing down what I would presume to be logic.

Soon after, I was able to think of a proper flowchart to accompany the logic. The flowchart starts with a while command to ensure that the game does not stop unless the player/computer has already won the game. With this thought, I gave myself another question. What does it mean to “win a game”? What are the parameters? What concrete evidence shows that someone has won the game?

And fortunately, I was able to think of more logic and more parameters to add to my flowchart as I drew it. I am in my zone. With more progress comes more questions, which is immediately accompanied by an answer to that question, resulting in more progress. And so, in the middle of the bus where everyone is shouting random numbers, in hope that the amount of thumbs raised is the same to his guess, I was taking apart a game that does not even physically exist.

And, as cocky as it may sound (because this is still a simple game, and there are a lot more experts out there, Russell), I was really proud of myself back then. In the end result, I came up with a flowchart, followed by some pseudo code written in Python that roughly sketches the program I was trying to make.

my brainstorm

However, it is with shame that I admit to not have work on it until May 2019. And so, it was what I did. And frankly enough, I didn’t understand any of it. Ironic, how even a difficulty is experienced while reading through old documentations that explains how the code works (maybe I need to comment by documentations next time)

But all hope was not lost. Fortunately, underneath all those messy hand writings with language I couldn’t understand, I was able to get the gist of the program. With that in mind, I decided to break down t he game again. This time, with a few resources already available, I was able to make major improvements that would’ve made the process much faster. And in the process, I was able to apply some new concepts about programming to this project! Before I continue on, here is my what part of the code looks like (source can be found in GitHub):