Skip to content
A very very simple Battleship game written in plain JavaScript
JavaScript CSS HTML
Branch: gh-pages
Clone or download
Latest commit d504573 Sep 28, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information. Update Sep 28, 2015
battleship.js Rename battleship to battleship.js Sep 28, 2015
index.html Create index.html Sep 28, 2015
style.css Rename main.css to style.css Sep 28, 2015


A very very simple Battleship game written in plain JavaScript:

Read about the game and its rules here:

Step 1: Create your files

Useful references:

Step 2: Create a grid on your HTML page for the game board

Useful references:

Step 3: Model the game board in JavaScript and place ships

Useful references:

Step 4: Create event handler and write the game logic

Useful references:

Step 5: Play the game!

Play the game here:

Features to implement next:

  • Display game messages within the HTML page instead of using alert()
  • Randomize placement of the ships at the start of each game
  • Make better graphics, maybe add sound effects?
  • Make a 2-player version of the game!
You can’t perform that action at this time.