Danger, Will Robinson!


#1

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] ??


#2

because you get indexes from your board lists


#3

sorry, can you elaborate or examples?


#4

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


#5

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


#6

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"


#7

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


#8

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


#9

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


#11

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