Lab6: Battleship

For this lab I created the classic game “Battleship” using Python. During this tutorial, I used different commands and loops, such as the for loop. Also, I used the if, elif and else statement for the results; and depending on the player guess, the game will show a specific message like “Congratulations! You sank my battleship!” or “You missed my battleship”. However, I also set a limit of guesses and if the player could not guess it right, the game would stop and display the “Game over’ message. It was fun to create this game with Python, but I had to be very careful with all the colons, brackets and parenthesis in order to make it readable to Python.

 

Part 1: B1

Part 2:B2

Part 3:B3

Part 4:B4