Recently I decided to brush up on my computer science foundation by enrolling in a popular online computer science course. As the final project of the first module, we were tasked with writing a basic terminal program in Python and documenting our journey in a blog post. I settled on modeling one of my favorite television game shows, Who Wants to Be a Millionaire?
I took an object-oriented approach for the implementation. There are three classes -
Prize - that are used to model the main components of the game. Two helper scripts,
play.py, control the game setup and gameplay mechanics respectively. The entry point,
millionaire.py, is in charge of welcoming the player and revealing their total prize money at the end of the game.
Here is the repository for the program. Clone it and play the game, then share the prize money you won in the comments section. No cheating!
Some improvements can be made to the program to make it more true to life:
- Introducing additional questions and answers for more variety
- Implementing the concept of lifelines to give the player support when stuck
- Grouping the questions into three tiers - easy, medium, and hard - to make them progressively difficult as a player's current prize money increases
This was a fun project to work on. Thank you for your time!