<?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: Sebastian</title>
    <description>The latest articles on DEV Community by Sebastian (@touff97).</description>
    <link>https://dev.to/touff97</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3476134%2F741c30bf-219f-465c-af57-26cfcee14904.png</url>
      <title>DEV Community: Sebastian</title>
      <link>https://dev.to/touff97</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/touff97"/>
    <language>en</language>
    <item>
      <title>CMinesweeperD: A Classic Game Reimagined in Python</title>
      <dc:creator>Sebastian</dc:creator>
      <pubDate>Tue, 02 Sep 2025 15:24:26 +0000</pubDate>
      <link>https://dev.to/touff97/cminesweeperd-a-classic-game-reimagined-in-python-1ngb</link>
      <guid>https://dev.to/touff97/cminesweeperd-a-classic-game-reimagined-in-python-1ngb</guid>
      <description>&lt;h2&gt;
  
  
  Why I Made This Game
&lt;/h2&gt;

&lt;p&gt;This project began as a challenge from Codecademy's Computer Science course. I wanted to push myself to create something interactive and nostalgic—so I chose to recreate Minesweeper, the classic puzzle game, entirely in the terminal using Python. It was a fun way to apply object-oriented programming concepts and explore how game logic works under the hood.&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%2Floofw1k5qc2ofm4agc7m.png" 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%2Floofw1k5qc2ofm4agc7m.png" alt=" " width="800" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The game is built around two main classes: Tile and Board.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tile represents each square on the board. It tracks whether it's a bomb, whether it's been discovered or flagged, and how many bombs are adjacent to it. It also handles its own display logic using ANSI escape codes for colorful terminal output.&lt;/li&gt;
&lt;li&gt;Board manages the grid of tiles. It randomly places bombs, calculates adjacent bomb counts, and handles user input. The board is displayed with column letters and row numbers for intuitive navigation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The game loop listens for two types of input:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DXY to discover a tile (e.g., DA3)
FXY to flag a tile (e.g., FB5)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The game ends when you either:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Discover a bomb (you lose 💥)
Correctly flag all bombs (you win 🎉)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The logic for recursive discovery (revealing adjacent empty tiles) and color-coded output makes the game feel dynamic and responsive, even in a simple terminal environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Touff-97/CMinesweeperD/releases/tag/Minesweeper" rel="noopener noreferrer"&gt;View the Code on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;I really enjoyed the process of building this. It was quick to get up and running, but it also sparked a lot of ideas for future improvements—like adding a timer, difficulty levels, or even turning it into a roguelike-style game with procedural generation and exploration mechanics.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
