I'm just running through 14. Test Run at the moment and trying out different scenarios but when I put lines that aren't within the board range in the raw input, it comes up with:
Traceback (most recent call last):
File "python", line 31, in
IndexError: list index out of range
I'm also not 100% sure on how to format the if, elif and else statements as the instructions didn't make it too clear... Looking at some other posts on this module, is it possible to nest an elif statement within the else statement? I was under the impression that it's supposed to be in order of if, elif, else...
Replace this line with your code. # Write your code below! if guess_row == ship_row and guess_col == ship_col: print "Congratulations! You sank my battleship!" elif board[guess_row][guess_col] == "X": print "You guessed that one already." else: print "You missed my battleship!" board[guess_col][guess_row] = "X" print_board(board) if guess_row not in range(5) or \ guess_col not in range(5): print "Oops, that's not even in the ocean."