Not_again!


#1

if guess_row == ship_row and guess_col == ship_col:
board[guess_row][guess_col] == "X"
print "Congratulations! You sank my battleship!"
elif guess_row not in range(len(board)-1) or guess_col not in range(len(board)-1):
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!"

i am stuck here. please help.it is asking did you remember to add you guessed already!in elif.


#2

Please make sure that it's easy to reproduce what you describe - preferable one would be able to copy the code from your post and paste it into the exercise (a link helps)

Try doing what I just described with what you posted


#3

can you fix my problem?


#4

I was hoping you'd describe the problem first so that there is something to fix :confused:
I mentioned earlier what's missing, I'm not sure if you read it


#5

When i run the above code, it is giving a message,
Saying,'did u remember to print "you guessed that one already!" ?
How to fix that?


#6

Saying,'did u remember to print "you guessed that one already!"

I don't think they spelled "you" as "u" - while that might seem insignificant, perhaps you also changed the message you were supposed to print slightly. If it's different then it's not the same, even if it's a small difference.


#7

Please help me to pass this exercise.


#8

Please read and consider what I have already said before asking anew. You keep ignoring my suggestions


#9

I'm so glad you said this. I was having a problem with this exercise and when I did as you suggested I found the error. The issue is the same here. You could point out the mistake but I understand the point you're making so I won't either.

Just a quick edit to add that while I understand the importance of reading through everything the exercises could be more user friendly. I'm still unsure if this code should be using the "Already guessed" part or if that's for upcoming exercises. If that was made more clear it would save a lot of head scratching for me.


#10

There are some communication requirements to get a straight answer out of me, yes. The rest of the time I'm a grumpy kindergarten teacher.

In a way learning to be precise around computers is one of the most important things for new programmers to learn. I agree that it should be accomplished with less frustration involved, but there's nothing I can do about that here


#11

sorry. I couldn't find the mistake.


#12

Read through what the exercise says then read your code. Have you done exactly what it asked? I know you haven't but you need to find what the error is here.


#13

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