Using a dictionary, ship names and lengths are stored. A ten by ten grid is print using for loops. Using a for and while loop, the ships orientation is randomly selected to be horizontal or vertical. A random coordinate within the ten by ten grid is selected and the entire length of the ship is placed in the grid. This continues for all the ships and the ships cannot overlap. The user than enters coordinates to find and sink the ships until all ships have been sunk in which case the game ends.
From this project I learned to how to implement for and while loops.
Clone this repository.