DEV Community

Cover image for A Newbies Attempt at Making the Classic Game Battleship
Francois Allerston
Francois Allerston

Posted on

A Newbies Attempt at Making the Classic Game Battleship

Well that's putting it lightly, say a Newbies Attempt at a lot of new things.

For my learning portfolio, the objective is to upload it to GitHub and to create a post sharing the link to GitHub. The problem..

Despite the world we live in today and even my own interests in technology, I find it odd how I have separated myself from social media platforms and an online presence.

I started a journey for myself in development, I knew there would be challenges on my path with regards to learning new skills. Imagining complex system designs that only mad or crazed scientists are seen working with (I was anticipating this with excitement) and I still can't wait to get to that point.

That path has lead me here.. I need to write a blog post, but lack the knowledge or experience (topped being an introvert) Coding all the sudden seems simple and easy. I've never written a post (so if this format seems a bit off or odd.. you know why).

Accepting that this will most likely be a part of the journey I want to be part of I figured (I could be wrong about this), telling this part of the story is still blogging? Right? if not.. it will build momentum, grow confidence and be a start of this specific topic.

Objective:

With regards to blogging:
I need catching up and learn a few more skills (not out the bat "go blog")

With regards to the game:
That's the just of it, I've created a simple text based game. The classic Battleship, which was quite the tricky dilemma. Battleship feels more of a visual type of a game so I had to create an environment to give the same visual queues and control. Here is how that looks when placing ships:

The link to the game source code is here:
Link

The Overview of my Battleship portfolio:

The goal was to create an application to run in the terminal and to use classes and objects.

The classes I created for this game is the Player and the Board (Battleboard)
*The Player - preforms tasks like attacking and updating the board
*The Board - performs tasks like allocating the placement of the ships

The game functions around the grid(A1, J10) or as I called them in the code "Tiles" - these gets assigned to the Players after placing is completed.

The game there forward runs on a loop till one player has no more "Tiles" remaining. For more of the details, overview the README file in the repo.

Conclusion:

The game I made can be found in my GitHub repo link above, it works and is fun to play. (give the High score system a crack)

It's not perfect, but that's the point. This is the process of learning (but don't take me wrong, I spent a lot of time and effort on this project trying to get things to work just right and making it look good.. by using just the terminal.. for a rookie)

I remember the initial anxiety (excited and afraid of the unknown) I felt when I just started to work and looking back on it now. It's like its starting again in this new environment, but different..

Looking forward to making better code..
Looking forward to making better blog posts.

I really hope that this first attempt at a blog was somewhat structured and readable.

I am truly grateful for your time spent reading through this

Top comments (0)