Question
The game Battleship is played on a grid board. Each opponent has multiple ships that are placed on the grid where the other opponent cannot
The game Battleship is played on a grid board. Each opponent has multiple ships that are placed on the grid where the other opponent cannot see them. In order to attack, each player takes turns calling out coordinates on a grid. If the attacker calls out a coordinate that hits their opponent's ship, they must call out, "Hit." You are going to be developing a computer program to mimic this game. Use the Gridlayout that is six columns by six rows. Randomly make one row or one column all ones. The other cells will be 0. The user should not see these values. When a user selects a cell, expose the value. The game is over when the user correctly selects all of the cells with 1s in them. Call this class Battleship.java.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started