Add saving functionality to the battleship program.