Skip to content

# battleship-game Battleship game is a war game played on ocean by two players. Each player own his battle area and each player will get same number of ships where each ship may have different size placed at some position in non-overlapping fashion. Note, players cannot see each others ship's location. The player who destroys all the ships of ot…

Notifications You must be signed in to change notification settings

anilyadavrtu/battleship-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configuration: 1) Import project as a maven project 2) Update the maven project

Run the project: Right click on PlayGame.java>run as java application Enter the input on console as - 5 E 2 Q 1 1 A1 B2 P 2 1 D4 C3 A1 B2 B2 B3 A1 B2 B3 A1 D1 E1 D4 D4 D5 D5

Expected result - Player-1 fires a missile with target A1 which got miss Player-2 fires a missile with target A1 which got hit Player-2 fires a missile with target B2 which got miss Player-1 fires a missile with target B2 which got hit Player-1 fires a missile with target B2 which got hit Player-1 fires a missile with target B3 which got miss Player-2 fires a missile with target B3 which got miss Player-1 has no more missiles left to launch Player-2 fires a missile with target A1 which got hit Player-2 fires a missile with target D1 which got miss Player-1 has no more missiles left to launch Player-2 fires a missile with target E1 which got miss Player-1 has no more missiles left to launch Player-2 fires a missile with target D4 which got hit Player-2 fires a missile with target D4 which got miss Player-1 has no more missiles left to launch Player-2 fires a missile with target D5 which got hit Player-2 won the battle

About

# battleship-game Battleship game is a war game played on ocean by two players. Each player own his battle area and each player will get same number of ships where each ship may have different size placed at some position in non-overlapping fashion. Note, players cannot see each others ship's location. The player who destroys all the ships of ot…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published