Battleship is a python based web application run in a mock terminal. It is a game where you need to guess where the opponents ships are on a board to sink them.The person who has sunk all the ships first wins.
- The user is welcomed at the beginning of the game and asked for their name. This inititates the start of the game.
- The board then sets up for you to make youe first guess to try sink a ship.
- You carry on until all your turns are up and you are told whether you win or lose.
This game is easy and straightforward and no two games will be the same as the ships are randomly placed on the board thanks to a python library called random.
Battleships is targeted at anyone. Any level of player can play. It's all down to how good your guesses are. Battleship has been around a long time and anyone of any age would appreciate it.
As a User:
- I want to quickly understand the purpose of the game
- Be easy to play
As a returning User:
- I want the playing method to still be easy and simple
As a site owner:
- I want to provide a fun simple game for users
- Build a python based web application that runs on a mock terminal
- Build a simple application with easy to follow instructions to play the game
- Build the application so that it runs on a mock terminal
- Design a simple game which is easy to follow with no previous knowledge of Batlleships
- Build the entire game in one file to play in the terminal
- This application should be easy to follow and not allow for empty values to be accepted
- Different types of battleships could be done
- Bigger board to accomodate ships covering more than one square and possibly at diagonals too
- Heroku-Python
- Heroku-Nodejs
- Random
Testing was primarily done in the terminal as i built the application as this was the easy thing to do. Just play around with the code. Once deployed the application ran in the terminal with minimal errors.
The one thing i couldn't get right for a while was the width of the columns. It was incredibly narrow and too narrow to play. i resolved this by putting a space in my "" to make it " " and that made all the difference. Easy fix but took me a while to register where the problem was in the code.
These are the steps to deploy our project to the mock terminal in Heroku which is required:
- on the main dashboard on the right click the "create app" button
- click the settings tab and click on "config vars"
- write in a KEY of "PORT" and VALUE of "8000". Click "add"
- add the required buildpack of "python" first then "nodejs" in that order
- click on the deploy tab. Select Github as deployment method. Connect to your profile.
- search for the repository you want to use and click "connect"
- chose to automatically or manually deploy your project
- once built,click "view".