Ship Battle was developed as my first python project by me as my third Full Stack Web Development project with Code Institute.
Since Python is a very interesting language easy to use, and unbelievably annoying when it comes to indentations and semi-columns, I've thought a battleship game would be a perfect choice. As a child, I always loved video games so I felt affinity regarding this project, just an amazing experience
Is a strategy-type guessing game for two players. It is played on ruled grids (paper or board) on which each player's fleet of warships is marked. The locations of the fleets are concealed from the other player. Players alternate turns calling "shots" at the other player's ships, and the objective of the game is to destroy the opposing player's fleet.
Ship Battle is based on the original version of the battleship game. In this terminal version, the user can place 5 different ships vertically and horizontally with a size of 2, 3, 4, 5 while the computer generates a random position on his board, the objective is to hit all 5 enemy ships
The Features were designed to be as simple as possible since is a terminal game you don't need much to play
-
User name :
-
Main menu :
-
instructions :
-
Ships placement :
-
Hit/Miss check :
-
Calling shots :
- The player may choose a vertical or horizontal orientation and a number from 1 - 8 to call his shot.
- Computer does the same by itself.
- Passed the code through PEP8 and only got line size issues nothing that compromises the game or the code flow.
- Used a lot of print statements to test every main function of the game.
- Type error value error and key error were used to check if the expected input was the right input.
- This project was deployed to Heroku follow the steps below to deploy.
-
- Create a Heroku account
-
- Click on create a new app
-
- Give the app a name of your choosing
-
- Pick your region.
-
- configure the settings the way it fits your project
-
- pick a deployment method.
-
- look for your repository name
-
- Click search and click connect
-
- pick between manual or automatic deployment
-
- Click on the link to see your project link
-
https://pythondex.com/python-battleship-game - for helping me understand the logic of a battleship game in Python
-
https://www.youtube.com/c/KnowledgeMavens1 - for being a stepping stone to build this project
I have a bad practice that is good to mention, to avoid unnecessary commits I like to code every major part in the Visual studio code so I don't need to commit a lot of things, I thought this was a very good idea at first, but this pushes a lot of inconsistency in my commits.
I would like to thank everyone who helped me with this project.
- My mentor.
- My good friend Armandinho.
- Jean my good French friend for all the support and advice.
- Code Institute for giving the best support to develop this project.