Danger, Will Robinson!


Hello: For line 33, i don't quite understand it.
why do i need to put board in front of the [guess_row][guess_col] ??


because you get indexes from your board lists


sorry, can you elaborate or examples?


board is a list, we can use [x] to get an item of the list at index x, where x is a number.


ok, why don't i need board[...] in front of line 29 then?


I believe it is because on line 29 we are just comparing two variables (the ones randomly generated and the ones the user enters) that are unrelated to the board itself. Line 33 seems to be when that changes, and we are using the board list to relate the user input to the board output.

*edit -- changed to "board list" from "board function"


because we have variable containing the guess and the ship coordinates, we can simply check if they are equal, why would use we use []?


2 posts were split to a new topic: Danger, will robinson


A post was merged into an existing topic: Danger, will robinson


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