Object-Oriented Programming · Square · Medium
Build a single-player version of the board game Battleship. The board holds five ships, each with a different length. When the ships are positioned, no two ships may share a cell, and every ship must lie entirely within the board's boundaries. During play, the player repeatedly calls out board coordinates as guesses. The game continues until all of the ships have been sunk.