Battleship project for The Odin Project. Made with HTML, CSS, and Javascript.
I learned a lot about Test Driven Development. It greatly helps with the logic and how we write our code, based on the tests. As a result we will encounter lesser bugs. It was definitely a learning experience, although I'm still not confident with it as I got used to logging everything in the console and using the debugger.
- Ships Factory
- ship array
- hit function
- isSunk function
- getShip function
- getNonHitPositions function
- Gameboard Factory
- board array
- place ship function
- occupy space in the board
- check board edges
- auto ship placement
- check win/lose condition
- be able to place ships vertically
- Players
- pure turn based
- be able to take turns
- create AI
- be able to do random plays
- not attack the same coordinates
- only valid moves
- smart ai
- be able to do random plays
- pure turn based
- DOM
- create 10x10 board
- add ships to deploy
- add announcer
- add styling
- small animations/effects
- fix specificity issues
- small animations/effects
- create event handlers
- whole code base refactor/perf optimization