Battleship is a strategy type guessing game for two players. It is played on ruled grids on which each player's fleet of warships are marked. The locations of the fleets are concealed from the other player. Players alternate turns calling "shots" at the other player's ships, and the objective of the game is to destroy the opposing player's fleet.
Here, you play against an intelligent (you may loose, no kidding) bot.
- Option to randomize fleet generation and positioning
- Nice draggable UI to re-orient and re-position ships
- Cool sound effects
- Continuosly adjusting grid cells so that it does not become too clear that you are dumb
- JavaScript - the one and only scripting language supported by all browsers
- Webpack - module bundler for JavaScript and frontend assets
- Jest - JavaScript testing framework
- HTML & CSS - the markup and stylesheet languages that the web can't do without
- ESLint & Prettier - (dev) JavaScript linter and prettier respectively
src/dom-cache/game-screen.js- query and cache game screen DOM nodesstarting-screen.js- query and cache start screen DOM nodes
globals/constants.js- global constant values for the game environmentimages/loading.svg- animation asset for loading statemodels/*.js- data models for game entities: game, player, ship, game-boardsounds/*.mp3- sound effect filesutils/attack-loci.js- calculate bot's next attack locationships-loci.js- generate initial ship positions
index.js- main driver filestyle.css- CSS stylesheettemplate.html- HTML markup
unit-tests/*.test.js- test suite for different functions
![]() |
![]() |
|---|---|
![]() |
![]() |



