I have pasted code created my me for Not again section. My code is executing successfully, but I dont believe this is going to work as intended. As per me, unless the previous column and row value for X is saved somehwere, we are never going to get an answer that "You guessed that one already." I was skeptic about my code.
But when i started doing Play it Sam, i saw a similar code as mine and now i'm thinking their is something completely wrong. Can someone help me here and point out where I went wrong or acknowledge my concern is valid and code is never going to print "You missed my battleship!"
if guess_row==ship_row and guess_col==ship_col: print "Congratulations! You sank my battleship!" else: if guess_row not in range(0,5) or guess_col not in range(0,5): print "Oops, that's not even in the ocean." elif board[guess_row][guess_col]=='X': print "You guessed that one already." else: board[guess_row][guess_col]='X' print "You missed my battleship!" print print_board(board)