Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use java. Thanks! the previous question could be found by: https://www.chegg.com/homework-help/questions-and-answers/2-boats-boat-represented-line-consecutive-squares-board-boats-may-overlap-boats-extend-out-q30141935 3 Turns Each turn, the user will input a location r, y to
please use java. Thanks!
the previous question could be found by: https://www.chegg.com/homework-help/questions-and-answers/2-boats-boat-represented-line-consecutive-squares-board-boats-may-overlap-boats-extend-out-q30141935
3 Turns Each turn, the user will input a location r, y to attack on the board. You can assume that a and y are integers, but you ll need to check if the pair z, 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 ht".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 x 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 will not be revealed, since the drone will not return to the user with any valuable informationStep 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