MVC, Lazy Initialization, Factory Methods: Battleship Lab
OverviewIf you are unfamiliar with the game of Battleship, watch this video:
Lab DescriptionIn this lab, you will construct half of the battleship game. You will get the computer to generate a random pattern of ships on a grid that the user cannot see.
The user will enter coordinate pairs while the computer will respond with one of three responses:
- You sunk my battleship
The grid of 10 x 10 coordinates need to be displayed as buttons using a GUI (javafx). When the user presses a button, it should turn red to indicate a hit or green to indicate a miss. When an entire ship is sunk, the corresponding buttons should turn black. The computer must also inform the player when all ships have been sunk such that the game is over. The computer does NOT need to keep track of the number of user misses as the game always continues until the user wins.