Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Battleship

How Its Made

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.

Lessons Learned

From this project I learned to how to implement for and while loops.

Install

Clone this repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages