Battleship!

BattleShip(4) BattleShip(2)BattleShip(3)battleship(5)BattleShip(4)

Lab Description

Since this unit of Code Academy had over 18 parts including an extra credit which wasn’t really required to complete, I was allowed to take a screenshot of the last 5 parts of the unit. For this lab, we were able to use many new codes and we made our own board just like battleship. We had to write out board = [] and board.append[“O”] *5 to make sure that the board has 5 O’s. There were some parts where I had a lot of errors because I indented incorrectly and the codes were wrong. There was also a debugging part where Python allows you to make errors so you can fix that specific code. There were definitely a lot of functions I had to define and a few strings below if, elif and else functions. Overall, playing Battleship on code academy was very entertaining but the codes took me some time. As you can see from the screenshots, the codes build up and all those codes allows you to input a random row and column and it will let you know if you hit the computer ship or not. Of course as long as you put print “Congratulations. You sank my battleship!” If you missed, it will say, “You missed my battleship!” I definitely enjoyed this lab because battleship is a fun game and playing it on code academy while typing out various codes makes it even more enjoyable.