Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adelura/battleship
https://github.com/adelura/battleship
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/adelura/battleship
- Owner: adelura
- Created: 2015-08-11T19:41:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-12T21:08:56.000Z (over 9 years ago)
- Last Synced: 2024-04-14T05:52:09.785Z (8 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
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.