I finally finished my first project. I would love to get some feedback on readibility of the code
The code will run if you follow the instructions. I know that some inputs will cause the code to crash, and will fix it. I just wanted to keep on learning.
Thanks for sharing your project. I did a Battleship Terminal Game as well and was really curious how you set about to tackle the task. The way your code looks shows me that you have understood way more of the a bit more advanced concepts of CS101, like classes, than me. That is definitely something you inspired me to use in my project as well.
I downloaded your game and tried to play it (I really LOVE battleship ), but after giving the initial coordinate the program always terminated with a TraceBack error whenever I tried to enter H or V for the distribution direction of the ship.
I would still love to play it once it works, so please keep me posted. Then I’d be happy to give you my feedback on player experience.
If you’d like to check out mine, you can find it here:
BTW, I really enjoyed reading your article. Neat, the way you explained the game in general!
Thanks for trying it out hahaha! Were you trying to enter lower case h or v? It was one of the points for me to fix in the future because the project was taking too much time and wanted to keep going.
However, I have now fixed it. The solution was simple, just add .upper() on the user input (line 54 & 68) to force the user input to be read as upper case (so that you dont get the key error when the program tries to look for a lower case key).
It should work now… let me know if it doesnt! I’ll have a look at yours during the weekend