Danger, will robinson


I had a code as follows:

print "You missed my battleship!"

(indentations were correct), not as displayed here.
I clicked "Save and Submit" and guessed the location of the ship, so I got a green light to go forward as if the code was correct.

But getting from a hint that I did not actually use the scheme listname[x][y], I felt that my code was wrong, I got back and got it right eventually: board[guess_row][guess_col]="X"

My question here is:should the fact that I was allowed to go through to the next lesson, though I got the code wrong, but only guessed the ship be considered a bug in your SW?
I fully understand, that since I guessed the ship, the else part did not apply, but it seems that it also means it was not checked by your SW.
Thank you

Danger, Will Robinson!
Danger, Will Robinson!

This is always a balancing point, if you want to make sure only the exact right code gets through, there is no room for learners to play with

On the other hand, giving freedom means that some corner cases can get through, as you just experienced


Thank you for your answer, I understand and agree :slight_smile:


as for you indention, you need to format your code:


Thank you for a useful link


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