Question: Please use java. Thanks! 3 Turns Each turn, the user will input a location r, y to attack on the board. You can assume that

Please use java. Thanks!  Please use java. Thanks! 3 Turns Each turn, the user will
input a location r, y to attack on the board. You can

3 Turns Each turn, the user will input a location r, y to attack on the board. You can assume that z and y are integers, but you will need to check if the pair r,y is a valid location on the game board later If there is no boat at the location, print "miss" If the user has already attacked that location or location is out of bounds, print "penalty" If there is a boat, print "hit". If the boat sinks, print "sunk". Do not print "hit" again if the user has already "hit" this location In addition to normal cannon fire, the user will have the option to utilize a recon "drone" to scan a small area of the board. You can implement this option however you wish, as long as it is plain to the user what must be done to use the drone. The drone will allow the player to see the contents of the squares in a 3 3 area around the input location, but this will not count as a shot. Instead, the user will lose 4 additional turns while waiting for the drone to return from its mission. Therefore if the user chooses to use the drone, print "recon". If the user sends the drone out of bounds, the user will receive a penalty for a shot out of bounds, wait 4 additional turns for the drone to return but the board wil not be revealed, since the drone wl not return to the user with any valuable information If the user receives a penalty (for attacking the same spot twice or for attacking somewhere out of bounds), the user's next turn will be skipped. The game ends when all the boats have been sunk The game should report how many turns it took to sink all the boats, as well as the total number of cannon shots. Lower scores are better! 3 Turns Each turn, the user will input a location r, y to attack on the board. You can assume that z and y are integers, but you will need to check if the pair r,y is a valid location on the game board later If there is no boat at the location, print "miss" If the user has already attacked that location or location is out of bounds, print "penalty" If there is a boat, print "hit". If the boat sinks, print "sunk". Do not print "hit" again if the user has already "hit" this location In addition to normal cannon fire, the user will have the option to utilize a recon "drone" to scan a small area of the board. You can implement this option however you wish, as long as it is plain to the user what must be done to use the drone. The drone will allow the player to see the contents of the squares in a 3 3 area around the input location, but this will not count as a shot. Instead, the user will lose 4 additional turns while waiting for the drone to return from its mission. Therefore if the user chooses to use the drone, print "recon". If the user sends the drone out of bounds, the user will receive a penalty for a shot out of bounds, wait 4 additional turns for the drone to return but the board wil not be revealed, since the drone wl not return to the user with any valuable information If the user receives a penalty (for attacking the same spot twice or for attacking somewhere out of bounds), the user's next turn will be skipped. The game ends when all the boats have been sunk The game should report how many turns it took to sink all the boats, as well as the total number of cannon shots. Lower scores are better

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!