Battleship

screenshot-50

we are using an if statement so when the user guess the right answer its going to print “congrats! you sank my Battleship”

screenshot-52

also the Else statement, once the user guess the wrong answer it’s going to print “you missed my Battleship”

screenshot-54

when the user guess an answer which is not in the range(5) in either guess_col or guess_row it’s going to print “oops! that’s not even in the ocean”. to set that we create another if statement “ELIF”

screenshot-56

we use for loop to enable the user four turns each turn it will print 1 until 4

screenshot-57

we want the user to print game over once the user makes three guesses we use another if statement after the else

screenshot-58

now we use “break” condition to end the game -once the user get the wright answer- under the first condition.

screenshot-59

now we finished our programming everything should work perfectly.

screenshot-60