Danger Will Robinson!


print "You missed my battleship!"
board [guess_row][guess_col] = "X"

This is the right answer for those who are stuck.


Thank you very much. Sorry about the previous posts for some reason they were in the wrong order


board is a multi-dimensional list. lets do a little example:

test = [["x"],["y"],["z"]]

then you could update by using the indexes:

test[0][0] = "X"

now X has become uppercase. In your case you have variables which contain the coordinates guessed by the user, how could you use those to update your multi-dimensional list.


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