Skip to content

Instantly share code, notes, and snippets.

@edalquist
Forked from anonymous/battleship_2ship.py
Last active January 2, 2016 21:59
Show Gist options
  • Save edalquist/8367429 to your computer and use it in GitHub Desktop.
Save edalquist/8367429 to your computer and use it in GitHub Desktop.
Sunk1 = False
Sunk2 = False
if guess_row == ship_row1 and guess_col == ship_col1:
Sunk1 = True
board[guess_row][guess_col] = "S"
print "Congratulations! You sunk my battleship!"
elif guess_row == ship_row2 and
guess_col == ship_col2:
Sunk2 = True
board[guess_row][guess_col] = "S"
print "Congratulations! You sunk my battleship!"
# All other conditions thereby fall under "else"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment