New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

battleship

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

battleship

The game of Battleship

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 11 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts