0.0.7 • Published 8 years ago

battleship v0.0.7

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

battleship

An API for playing the game Battleship.

Battleship is a guessing game played by two players. When a ship is sunk, you announce "You sank my battleship" (or 3-size, etc.)

See the test.js for usage.

Game

Create game.

  • Board(width, height)
    • x tiles: (0 .. width-1)
    • y tiles: (0 .. height - 1)

TODO

  • Create a basic API for a normal game.
    • Create a new board
    • Place ships on a board id
    • Start a game with a board (validate the board)
    • Hit an (x, y)
      • Hit, Miss, Sunk(boat)
  • Create a UI for the API.
  • Make the game scale to hundreds of square tiles and thousands of ships of various lengths.

Inspiration

Inspired by an interview question.

Tests

Run tests:

yarn
npm test -- --watch
0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.1

8 years ago

0.0.2

10 years ago