<?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: Tim</title>
    <description>The latest articles on DEV Community by Tim (@timjquigg).</description>
    <link>https://dev.to/timjquigg</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%2F835644%2F5f23f437-d84a-4633-882b-0ce9aade0a49.jpeg</url>
      <title>DEV Community: Tim</title>
      <link>https://dev.to/timjquigg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/timjquigg"/>
    <language>en</language>
    <item>
      <title>Terminal Battleship Game</title>
      <dc:creator>Tim</dc:creator>
      <pubDate>Thu, 24 Mar 2022 02:10:32 +0000</pubDate>
      <link>https://dev.to/timjquigg/terminal-battleship-game-4gjj</link>
      <guid>https://dev.to/timjquigg/terminal-battleship-game-4gjj</guid>
      <description>&lt;p&gt;I am currently going through the Computer Science Career Path with &lt;a href="//codecademy.com"&gt;Codecademy.com&lt;/a&gt;. The first section of the program is called &lt;strong&gt;CS101: Introduction to Programming&lt;/strong&gt; and uses the Python programming language to teach basic computer programming concepts and skills. I had previously studied computer science in highschool and university on my way to my engineering degree, but that was so long ago I've wanted a refresher in the basics.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--21A20akH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2asc370vk8n3y6tr8395.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--21A20akH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2asc370vk8n3y6tr8395.png" alt="In Progress Code" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of this section of the career path, there is a portfolio project where it is required to create a basic interactive game using Python that can be played in the terminal. For this I had decided that I was going to create a version of Battleship. My plan was to start out with a 1 player game and once I had the basic functionality in place, add the 2 player functionality.&lt;/p&gt;

&lt;p&gt;I know some of my code could be made simpler with using additional modules, as Python has an almost unlimited list of modules that can be called upon to perform a task, but I wanted to practice with base Python as much as possible and limit external module usage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yzxVh2Gf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6235efkwdhv8q4qrfoqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yzxVh2Gf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6235efkwdhv8q4qrfoqo.png" alt="Opening Screen" width="785" height="701"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting a basic 1 player version working, I tackled a 2 player version. Initially I had planned to use 2 different classes, one for ships and a second for the boards but quickly realized the code got easier if I added a third class for the player. Once the 2 player version was working I had to go back and re-write the 1 player logic to work with the modifications that were required to get 2 player to work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7svnWUj5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki4i0o8sca6o50ntsana.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7svnWUj5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki4i0o8sca6o50ntsana.png" alt="Two Player Game, Medium Difficulty" width="785" height="1085"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All in all I am happy with the functionality of the game and am proud of how it turned out. In the future I may come back to this project to improve the input validation from the user as was as refactor the code to use external modules were it would improve efficiency.&lt;/p&gt;

&lt;p&gt;You can find this project on my github page &lt;a href="https://github.com/timjquigg/battleship"&gt;here&lt;/a&gt;. I look forward to continuing my coding journey.&lt;/p&gt;

&lt;p&gt;Tim&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>bash</category>
      <category>code</category>
    </item>
  </channel>
</rss>
