Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adelura/battleship


https://github.com/adelura/battleship

Last synced: 22 days ago
JSON representation

Awesome Lists containing this project

README

        

### Battleship game

Clone this repository and execute `$ npm install`. To run tests execute `$ npm test`. To run aplication execute `$ node app.js`.

#### Background

The Problem: Implement a very simple [game of battleships](http://en.wikipedia.org/wiki/Battleship_(game)). If you've never played the game, you can get a feel for it from this online [flash game](http://www.learn4good.com/games/board/battleship.htm). You should create a simple console (browser or terminal) application to allow a single human player to play a one-sided game of battleships against the computer. The program should create a 10x10 grid, and place a number of ships on the grid at random with the following sizes:

* 1x Battleship (5 squares)
* 2x Destroyers (4 squares)

The console application should accept input from the user in the format "A5" to signify a square to target, and feedback to the user whether the shot was success, and additionally report on the sinking of any vessels. Do not spend any time formatting output in the console window (displaying a grid etc) - focus on the domain rather than the presentation.