turns = [4, 6, 2, 8, 1, 9, 5, 5, 3, 7, 6, 8, 2, 4]
turns.append([1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4])
turns.append([4, 6, 2, 8, 1, 9, 6, 5, 3, 7, 6, 8, 2, 4])
turns.append([0, 0, 26, 24, 3, 7, 5, 4, 25, 25, 21, 21, 21, 21])
turns.append([0, 0, 0, 0, 7, 3, 8, 2, 0, 0, 29, 29, 29, 29])
turns.append([0, 0, 0, 0, 26, 24, 0, 0, 0, 0, 0, 0, 0, 0])
arrayValue = turns[j][i]
if arrayValue == turnCurrently:
Error Message:
Traceback (most recent call last):
File "D:/a45d32f947055690c690d94f88/TicTacToe", line 183, in <module>
arrayValue = turns[j][i]
TypeError: 'int' object is not subscriptable
My question is essentially, I want to test if turns[j][i] is equal to turnCurrently but I keep running into this subscriptable problem, I haven't been able to find this answered anywhere I think that this is a very important question. Thanks in advance,
Richard
turnsin this form? You create a plain list in the beginning, then append new lists to it, so it looks almost like 2D, but not quite.