Bad Aim (section)-- Need Help!


#1

My code seems to work but I keep getting the error message "Oops try again .Make sure you print "Oop,that's not even in the ocean.".If the user guesses a row or column that is off the board"

I checked the other answers in the forum and they provide similar or same answers but I can't get my code to work.PLEASE HELP!!

if guess_row == ship_row and guess_col == ship_col:
print "Congratulations! You sank my battleship!"
else:
if guess_row not in range(4) or guess_col not in range(4):
print "Oops,that's not even in the ocean."
else:
print "You missed my battleship!"
board[guess_row][guess_col]="X"
print_board(board)


Replace this line with your code.

`


#2

I cut the code onto a notepad an re-pasted and it worked! I dont know what worked.Here is the code that worked now:


#3
print "Oops, that's not even in the ocean."

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.