<?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>Forem: charlesdmg-hash</title>
    <description>The latest articles on Forem by charlesdmg-hash (@charlesdmghash).</description>
    <link>https://forem.com/charlesdmghash</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%2F3518728%2Fd0d58270-d72f-4c52-88d8-d1af383ab700.png</url>
      <title>Forem: charlesdmg-hash</title>
      <link>https://forem.com/charlesdmghash</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/charlesdmghash"/>
    <language>en</language>
    <item>
      <title>BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!</title>
      <dc:creator>charlesdmg-hash</dc:creator>
      <pubDate>Sun, 21 Sep 2025 00:22:20 +0000</pubDate>
      <link>https://forem.com/charlesdmghash/best-battleship-terminal-game-to-date-i-think-l93</link>
      <guid>https://forem.com/charlesdmghash/best-battleship-terminal-game-to-date-i-think-l93</guid>
      <description>&lt;p&gt;This project was assigned to me in a codecademy course, i had to pick what game i wanted to recreate or create in a terminal. I just thought that batlleship was the perfect game, something fun and that can be made a little complex at least for a beginner like me.&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%2Ft5pc91lnfdcrzaeksgqv.gif" 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%2Ft5pc91lnfdcrzaeksgqv.gif" alt=" " width="720" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code consist of a Player Class that creates the playing board and the attacking board. 10x10 both obviously. A string method to represent the board in a cool looking way. A place ships method that make sure every player position it ships in an available and possible location without collisioning.&lt;/p&gt;

&lt;p&gt;And lastly and attack method. You know what that does LOL!.&lt;/p&gt;

&lt;p&gt;We have dictionaries with list or tuples, to represent the status of each part of the ship, the key being the ship and the value a list of the respective point of the chip, for example Destroyer has a length of 2 so a list of lenght two. And a tuple to represent what position the ship was hit.&lt;/p&gt;

&lt;p&gt;The game loop basically makes sure every player position their ships, that the inputs are okay and thats it. Sounds simple saying it lol, but wasnt for me!!!&lt;/p&gt;

&lt;p&gt;Github:&lt;br&gt;
&lt;a href="https://github.com/charlesdmg-hash/battleship-terminal-game" rel="noopener noreferrer"&gt;https://github.com/charlesdmg-hash/battleship-terminal-game&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was a challenge for me but im very proud of the outcome and what i learned. For sure in the future will polish this project with IA or something like that.&lt;/p&gt;

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