GithubHelp home page GithubHelp logo

battleship-game's Introduction

BattleShip Game

Java program for a 2 Player game of BattleShip

The game is played on two fields, each 10 X 10 squares. The columns are labeled A-J, and the rows are labeled 1-10. Each player's fleet of ships consists of one aircraft carrier, one battleship, one destroyer, one submarine and one cruiser. The size and shape of each ship is as follows:

Destroyer (2 squares): Submarine (3 squares): Cruiser (3 squares): Battleship (4 squares): Aircraft Carrier (5 squares):

Before the game starts, each player secretly places their ships anywhere on their own playing field. Ships cannot overlap one another, but may be placed either vertically or horizontally.

Players take turns to try to guess the location of the other's ships by naming a square (e.g. F7). The opponent declares the square to be a hit or a miss, depending on whether there is a ship occupying that square. When all the squares occupied by a particular ship have been guessed, the player must announce that that particular ship is sunk. A player keeps track of the hits and misses on a copy of the opponent's field.

During each player's turn, only their board is completely visible whereas the opponent's board only shows attacked squares, i.e. HITS (X) and MISSES (M).

The first player to sink all the other's ships is the winner.

Project UML : Project UML

battleship-game's People

Contributors

sambarannnn avatar

Stargazers

s1tr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.