<?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: mDex2409</title>
    <description>The latest articles on DEV Community by mDex2409 (@mdex2409).</description>
    <link>https://dev.to/mdex2409</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%2F2806592%2F8cc6472d-2125-4fd3-a4bf-0c41c9577ff5.png</url>
      <title>DEV Community: mDex2409</title>
      <link>https://dev.to/mdex2409</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mdex2409"/>
    <language>en</language>
    <item>
      <title>Building My First Python Terminal Game: Hangman</title>
      <dc:creator>mDex2409</dc:creator>
      <pubDate>Wed, 05 Feb 2025 12:12:17 +0000</pubDate>
      <link>https://dev.to/mdex2409/building-my-first-python-terminal-game-hangman-aa8</link>
      <guid>https://dev.to/mdex2409/building-my-first-python-terminal-game-hangman-aa8</guid>
      <description>&lt;p&gt;As part of Codecademy’s Computer Science 101 course, I recently built a simple Hangman game in Python. While it’s a beginner project, it was a great opportunity to practice structuring code, handling user input, and managing game logic.&lt;/p&gt;

&lt;p&gt;The game follows the classic Hangman rules:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The program selects a random word from a predefined word bank.
The player guesses letters one at a time.
If they guess correctly, the letter is revealed in the word.
If they guess incorrectly, they lose a life.
The game ends when the player either guesses the word or runs out of lives.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I structured the game using a HangmanGame class to manage game logic, along with a separate WordBank class to handle word selection based on difficulty.&lt;/p&gt;

&lt;p&gt;One challenge was refactoring my initial script into a class-based structure. At first, I had everything in a single procedural script, which made it harder to manage. Breaking it into classes improved organization and made future updates easier.&lt;/p&gt;

&lt;p&gt;I also learned a lot about handling user input, ensuring invalid inputs don’t break the game flow. This project was a great first step, and while I know I have a long way to go in my coding journey, I’m happy with the progress so far.&lt;/p&gt;

&lt;p&gt;If you’re interested in checking out the code, you can find it here: &lt;a href="https://github.com/mDex2409/CS101Hangman" rel="noopener noreferrer"&gt;https://github.com/mDex2409/CS101Hangman&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
