Battleships is a terminal game that runs on Heroku. The object of the game is to beat the computer at the game before it beats you
https://battleship-a.herokuapp.com/
This battleship game allows the user to sink the battleship with 4 turns before it's game over. Its a simplified version of the game. The main features of the game are.
-
A welcome message with the a brief message and a description of the game
-
There is a feature which you can enter your name and a prompt which greets the player
-
If you hit a ship a prompt with the message "You've hit a battlship!" appears on the screen.
-
If you miss the co-ordinates by a wide margin, the message "Missed by miles that's not even close" appears.
-
If you take a shot that has already been taken the message "You guessed that already" appears
-
Your misses are marked by an "X" with the following messsage "You've missed"
-
After 4 consecutive misses you need to play a new game, the termnal prompts the message "Game over"
• Gitpod to run the project on as an IDE
• Heroku to run the project on an external terminal
• W3 Schools to learn more about Python and indentation and functions
• PEP8 online checker to check my results and to see if my Python Code was formatted correctly
Initially , I found it difficult to indent some of my code when passing it through the PEP8 online checker, I had to rely on Tutor support to talk me through this issue , it was easlily rectified in the end. WELCOME = str(input('Welcome to Battleship!!' 'The object of the game is to sink the computers ships')) My indentation initially was out of place with the second line of code place to the left.
- print(*b) I found that this print command was easier to implement rather than by using join method which I found I would not work. I tried to print " " .join board which gave an error, print(*b) however worked.
I also found it difficult to implement a character representing a hit, I initially tried to implement the "&" symbol but found I couldn't, however with more practice.
No bugs remaining.
PEP8. No errors were returned.
This project was deployed on Code Institute's mock Heroku terminal
The site was also deployed to GitHub pages. The steps to deploy are as follows: In the GitHub repository, navigate to the Settings tab From the source section drop-down menu, select the Master Branch Once the master branch has been selected, the page will be automatically refreshed My project will not run efficiently on Heroku m, although it works well on Gitpod . I will need to rectify this proble when I repeat the project.
I'd like to thank the Code Institiute Tutoring team for many of their tips when implementing this project . I found their instruction be extremely helpful.
I found the following sources of help when trying to implement my project.