Skip to content
Simple version of the one-sided game of Battleships
C# HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Battleships.Web.Test
Battleships.Web
.gitignore
Battleships.sln
Battleships.sln.DotSettings.user
LICENSE
README.md
screenshot.png

README.md

Battleships

Simple version of the game Battleships allowing a single human player to play a one-sided game of Battleships against ships placed by the computer.

Screenshot

Build and run

It is a simple .NET Core app therefore all you have to do to run it locally is to run build

> dotnet build

and then run local web server

> dotnet run --project Battleships.Web

Tests are also available by standard CLI command dotnet test.

Objectives

The program should create a 10x10 grid, and place several ships on the grid at random with the following sizes:

  • 1x Battleship (5 squares)
  • 2x Destroyers (4 squares).

The player enters or selects coordinates of the form “A5”, where “A” is the column and “5” is the row, to specify a square to target. Shots result in hits, misses or sinks. The game ends when all ships are sunk.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

You can’t perform that action at this time.