dwgrossberg / battleship

A TDD implementation of the classic game Battleship

Home Page:https://dwgrossberg.github.io/battleship/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

battleship

See a project demo here 👈

A TDD implementation of the classic game Battleship


Tech Stack

  • Written in vanilla JavaScript and Sass (scss)
  • Bundled together using Webpack
  • All unit testing handled by Jest
  • Organized with ESLint and Prettier

Example game vs. roboPlayer


Objectives & Challenges

The main goal of this project was to build a small game app by utilizing the principles of test-driven-development. This was my first experience with any type of unit testing and it really made me restructure my workflow, especially at the start of the project. Instead of branching out in a dozen directions at once, creating unit tests forced me to slow down and focus on writing technically sound code, one module at a time. This approach was a challenge for me, particularly in the beginning, but I stuck with it long enough to see the clear benefits and value of TDD. While the project did take a little longer to get off the ground, once I finalized my unit-tested modules, the rest of the app was far simpler to complete. I was able to focus on the design and execution of the project, without needing to make awkward/painful adjustments to the core logic after the fact. In the end, I believe that the process absolutely helped me to create a stronger and leaner application, while also improving the overall quality of my code production.


Key Features

  • Simple and intuitive design is easy-to-use
  • 1-player mode + 2-player mode
  • Easily change your player name at the start of each game
  • Randomly place all of your ships on the board with the click of a button
  • ...or simply drag and drop your ships onto the board (makes use of the HTML Drag and Drop API)

Built as part of the free Odin Project curriculum

About

A TDD implementation of the classic game Battleship

https://dwgrossberg.github.io/battleship/


Languages

Language:JavaScript 84.3%Language:SCSS 15.7%