
A digital version of the classic game. You can view the live project here.
In this project I practiced:
-
Code:
- test-driven development and unit testing with Jest
- writing recursive functions to generate the computer/opponent's behavior
-
Design
- dragging and dropping objects
Helpful Resources
- JavascriptTutorial.net's tutorial on dragging and dropping.
- The battleship icon is by Atif Arshad, from the Noun Project
Potential future updates
- Make the computer smarter so it guesses adjacent squares when it hits a human ship
- Add ghost versions of the ships so that you can visually track how many ships you've sunk
- Make the gameover message more prominent