- The scope of this project was to build the Battleship game only throught Test Driven Development.
- It was unusual at first to write the Unit Testing and then start writing the code to make it pass, but it was a really fun and enjoyable experience in the end!
- I worked with Classes again for Ship/Player/Gameboard/AI constructors, and all the game checking logic happens inside of the Classes.
- After finishing the App, I learned how to manipulate the DOM to creaate the User Interface.
- Furthermore, I have implemented an instructions panel and a mobile version that toggles between the 2 boards. The current version is not entirely responsive, but you can play it in the desktop and mobile version.
- See the full live preview here
git clone https://github.com/janaiscoding/battleship.git
cd battleship
npm install
npx webpack
npm run test
- Play the classic game of Battleship against the AI!
- You can place your ships horizontally or vertically.
- You can't place your ship if another ship is taking that entire space.
- You can't interact with the computer board until you placed all your ships.
- You can't see the computer board's cells until you use your attacks.
- First to sink all the ships wins! You can play as many times as you want!
- The hit icon used in this project is from Font Awesome Icons.
- This project is part of The Odin Project's curriculum.
- Vanilla JS
- CSS3
- HTML5
- Jest
- Visual Studio Code
- npm package manager
- Webpack Module Bundler
- Linux Terminal
- Git and Github
- Mobile Responsiveness (check)