Skip to content

fcasibu/battleship

Repository files navigation

battleship

Battleship project for The Odin Project. Made with HTML, CSS, and Javascript.

Demo

Live Preview

Screenshots

App Screenshot

Lessons Learned

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.

Acknowledgements

TODO

  • 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
  • DOM
    • create 10x10 board
    • add ships to deploy
    • add announcer
    • add styling
      • small animations/effects
        • fix specificity issues
    • create event handlers
    • whole code base refactor/perf optimization