<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rodney Kimathi</title>
    <description>The latest articles on DEV Community by Rodney Kimathi (@krodney).</description>
    <link>https://dev.to/krodney</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F956797%2Fe4eb1f04-9d7c-4dee-b69f-43d3f137eddc.png</url>
      <title>DEV Community: Rodney Kimathi</title>
      <link>https://dev.to/krodney</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krodney"/>
    <language>en</language>
    <item>
      <title>Who Wants to Be a Millionaire?</title>
      <dc:creator>Rodney Kimathi</dc:creator>
      <pubDate>Thu, 27 Oct 2022 09:47:37 +0000</pubDate>
      <link>https://dev.to/krodney/who-wants-to-be-a-millionaire-29i1</link>
      <guid>https://dev.to/krodney/who-wants-to-be-a-millionaire-29i1</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;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, &lt;em&gt;Who Wants to Be a Millionaire?&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Program
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2lMhceRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vggsdq3mqk9n46e9psu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2lMhceRV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vggsdq3mqk9n46e9psu.png" alt="Screenshot of the program" width="880" height="653"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I took an object-oriented approach for the implementation. There are three classes - &lt;code&gt;Question&lt;/code&gt;, &lt;code&gt;Answer&lt;/code&gt;, and &lt;code&gt;Prize&lt;/code&gt; - that are used to model the main components of the game. Two helper scripts, &lt;code&gt;setup.py&lt;/code&gt; and &lt;code&gt;play.py&lt;/code&gt;, control the game setup and gameplay mechanics respectively. The entry point, &lt;code&gt;millionaire.py&lt;/code&gt;, is in charge of welcoming the player and revealing their total prize money at the end of the game.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/krodney/millionaire"&gt;Here&lt;/a&gt; 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!&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Some improvements can be made to the program to make it more true to life:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introducing additional questions and answers for more variety&lt;/li&gt;
&lt;li&gt;Implementing the concept of &lt;a href="https://en.wikipedia.org/wiki/Who_Wants_to_Be_a_Millionaire%3F#Lifelines"&gt;lifelines&lt;/a&gt; to give the player support when stuck&lt;/li&gt;
&lt;li&gt;Grouping the questions into three tiers - easy, medium, and hard - to make them progressively difficult as a player's current prize money increases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was a fun project to work on. Thank you for your time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
    </item>
  </channel>
</rss>
