Danger, will robinson


#1

Hi!
I had a code as follows:

else:
print "You missed my battleship!"
guess_row="X"
guess_col="X"
print_board(board)

(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!
#2

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


#3

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


#4

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


#5

Thank you for a useful link


#6

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