Write a program in java in which you will build the“Sink theShipsGame”. The Game has a8 x 8 grid and threeships. Each ship takes up exactly three cells. In the game, it’s you against thecomputer, but unlike the real battleship game, you don’t place any ships on yourown. Instead, your job is to sink the computer’s ship in the fewest number of guess. Goal:Sink all the computer’s ships(three in this case)in the fewest number ofguesses. You’re given a rating or level, based on how well you perform.Setup:When the game program is launched, the computerplaces three ships on a8x 8 grid(for an example, see the figure below).The ships can be placed eithervertically or horizontally (no other placement is valid)on empty cells of the grid.When that’scomplete the game asks for your first guess. The computer will prompt you to enter a guess(a cell), that you will type at the command-line as “1 3”(where “1 3” means 3rdcell ofthe 1strow), “45”, etc.. In response to your guess, you will see a result at thecommand line,either “Hit”, “Miss”, “Kill” (or whatever the lucky battleship of the dayis!). When you have sank all three battleships, the game ends by printing out your rating. Here is a sample run of the game: Your goal is to sink three ships. Battleship1, Battleship2, Battleship3 Try to sink them all in the fewest number of guesses Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 3 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 1 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 2 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 1 kill Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 3 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 7 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 3 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 4 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 5 kill Enter a guess [row (1 to 8)] [col (1 to 8)]: 5 1 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 61 1 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1 miss Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 4 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 5 hit Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 6 kill All Ships are sank! It only took you 18 guesses. You got out before your options sank. When player can finish the game within 20 guesses, print the following message (where xx is the number of guesses): All Ships are sank! It only took you XX guesses. You got out before your options sank. If it takes more than 20 guesses, print the following message All Ships are sank! Took you long enough. XX guesses. Fish are dancing with your options. The java program should terminate after 25 guesses and it should reveal the positions of the ships and their status. Solution Please follow the code and comments for description : CODE : import java.util.Random; // required imports for the code imp.