<?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: eglasb</title>
    <description>The latest articles on DEV Community by eglasb (@eglasb).</description>
    <link>https://dev.to/eglasb</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%2F2885061%2Fe450a82d-ee1e-4c23-86b7-3f0ce66cd1e2.JPG</url>
      <title>DEV Community: eglasb</title>
      <link>https://dev.to/eglasb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eglasb"/>
    <language>en</language>
    <item>
      <title>Building a Hangman Game in Python - With a Linguistic Twist!</title>
      <dc:creator>eglasb</dc:creator>
      <pubDate>Thu, 20 Feb 2025 03:57:22 +0000</pubDate>
      <link>https://dev.to/eglasb/building-a-hangman-game-in-python-with-a-linguistic-twist-8j8</link>
      <guid>https://dev.to/eglasb/building-a-hangman-game-in-python-with-a-linguistic-twist-8j8</guid>
      <description>&lt;h2&gt;
  
  
  In_r_duc_i_n
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ________
   |/     |
   |     ___
   |    |ó,ò|
   |    \_-_/
   |      
   |
   |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Ever wanted to learn Portuguese while playing a classic game? Well, you might not become fluent, but playing my Hangman (Forca) game in Portuguese will at least teach you some words — and test your guessing skills! As part of my Python learning journey, I decided to build a Hangman game in the terminal. This project helped me understand concepts like string manipulation, loops, and object-oriented programming while having fun. The ideia was to make it a very polished experience, without unexpected crashes, counting games and victories, calling the player by the name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Project "Forca"
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fl1vsta8vin157inbjt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fl1vsta8vin157inbjt.jpg" alt="Image description" width="598" height="492"&gt;&lt;/a&gt;&lt;br&gt;
Prepare for gruesome death!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxd5jc1xrybgoh6tortx4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxd5jc1xrybgoh6tortx4.jpg" alt="Image description" width="608" height="512"&gt;&lt;/a&gt;&lt;br&gt;
And Victory!&lt;/p&gt;

&lt;p&gt;For this project I´ve created 4 classes and a utility file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Game - manages game flow&lt;/li&gt;
&lt;li&gt;Player - manages player data (lives, letters played, etc.)&lt;/li&gt;
&lt;li&gt;SecretWord - deals with word management and revealing letters&lt;/li&gt;
&lt;li&gt;HangmanDoll - holds the ASCII art.&lt;/li&gt;
&lt;li&gt;utils.py - contains some shared functions for reading file, clearing screen and input validation
I tried to use a modular approach and type hints to really exercise OOP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was a great learning experience and I think the game turned out to be really funny to play!&lt;/p&gt;

&lt;p&gt;I used Python in VScode for the entire game logic and Git for version control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code on GitHub
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/eglasb/Forca.git" rel="noopener noreferrer"&gt;https://github.com/eglasb/Forca.git&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Future improvements
&lt;/h2&gt;

&lt;p&gt;I intend to eventually add a GUI. Maybe Pygame?&lt;/p&gt;

</description>
      <category>terminalgames</category>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
