BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!

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 beginn…


This content originally appeared on DEV Community and was authored by charlesdmg-hash

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.

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.

And lastly and attack method. You know what that does LOL!.

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.

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!!!

Github:
https://github.com/charlesdmg-hash/battleship-terminal-game

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.


This content originally appeared on DEV Community and was authored by charlesdmg-hash


Print Share Comment Cite Upload Translate Updates
APA

charlesdmg-hash | Sciencx (2025-09-21T00:22:20+00:00) BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!. Retrieved from https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/

MLA
" » BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!." charlesdmg-hash | Sciencx - Sunday September 21, 2025, https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/
HARVARD
charlesdmg-hash | Sciencx Sunday September 21, 2025 » BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!., viewed ,<https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/>
VANCOUVER
charlesdmg-hash | Sciencx - » BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/
CHICAGO
" » BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!." charlesdmg-hash | Sciencx - Accessed . https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/
IEEE
" » BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!!." charlesdmg-hash | Sciencx [Online]. Available: https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/. [Accessed: ]
rf:citation
» BEST BATTLESHIP TERMINAL GAME TO DATE!!! I THINK?!!! | charlesdmg-hash | Sciencx | https://www.scien.cx/2025/09/21/best-battleship-terminal-game-to-date-i-think-3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.