Skip to main content
Jakov Ivan

Making Math Fun: The Chocolate Chili Game

I recently started the CS50 online course offered by Harvard University. This is by far one of the most engaging yet challenging introductory courses to computer science and the art of programming. As an Applied Math Major who loves coding algorithms yet has no formal computer science background, I felt that this course would be perfect for me in solidifying my foundation in computer science. You can check the CS50 (2018 version) here.

For Week 0’s homework, we were asked to create a project using Scratch. Scratch is a fun educational tool created by MIT that teaches you the basics of programming. I fell in love with Scratch because of its interactive color-coded blocks which lets you get your hands dirty and just play around. It brought me back to my childhood leisure every summer where I make small LEGO carts and do a procession of them around our house.

For our first homework, I decided to create a project that would showcase the creative and fun side of my first love--mathematics. When I first taught Calculus for Business in college, I decided to have a recreational math day for my students after they take a long test in my class. In one of these recreational math days, I played the Chocolate Chili Game with my students in groups, and we stayed in the classroom another half an hour after our class officially ended just for each group to know the winning strategy, and satisfy their mathematical curiosity.

The rules of the game are simple: I have a cup with 13 chocolates and 1 chili. My student and I would each take turns in getting 1, 2, or 3 chocolates from the cup. The goal of the game is to make sure that you don’t end up with the chili during your turn. Since there are no more chocolates left in the cup, the loser has to eat the chili! Since I know the winning strategy, I had the upper hand for the first games, and my students kept on getting the chili.

Based on this game, I created my first project using Scratch, and I called it ‘Dodge n Fudge’ game. You can play the game below, and you can play it also with your family and friends! Say hi to Pi-nguin and Cat-culus!