DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Who Wants to Be a Millionaire?
Rodney Kimathi
Rodney Kimathi

Posted on

Who Wants to Be a Millionaire?

Introduction

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?

The Program

Screenshot of the program

I took an object-oriented approach for the implementation. There are three classes - Question, Answer, and Prize - that are used to model the main components of the game. Two helper scripts, setup.py and 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!

Conclusion

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!

Top comments (0)

πŸ” If you came here from Google, why not take a look at some of our top posts?