The challenge is to program a simple version of the game Battleships.
Create an application to allow a single human player to play a one-sided game of Battleships against ships placed by 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 player enters coordinates of the form “A5”, where "A" is the column and "5" is the row, to specify a square to target. Optionally, you can use also the mouse click on the cell.
Shots result in hits, misses or sinks.
The game ends when all ships are sunk.
-
Notifications
You must be signed in to change notification settings - Fork 0
xiaomei-wu/game-battleships-vanilla-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple battleship game using vanilla javascript, html and css
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published