Creating a function guess_index that will tell where number is on board. So if I have a 4x4 board, the the numbers will be
[
[2,False], [3,False], [4, False], [1, False]
[ Same line as above
[same line as above
[same line as above
]
So, first I need to convert that into a list like this below
[
[0,1,2,3],
[4,5,6,7],
[8,9,10,11],
[12,13,14,15]
]
So guess_index(board, 3) should return [0,3] meaning that the number 3 is located on the 0th row & the 3rd column. Likewise guess_index(board, 14) should return [3,2]. The tricky part is getting it to work for a 2x4 vs a 4x2 matrix etc
My code is
def guess(board, guess)
count = 0
for i in board:
for j in i:
board[i][j] == [count]
count += 1
for a in board:
for b in a:
if b == guess:
return [a,b]
However I'm just getting None when I try the examples I wrote above??