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
我的问题本质上是,我想测试是否turns[j][i]
等于turnCurrently
但我一直遇到这个可下标的问题,我无法在任何我认为这是一个非常重要的问题的地方找到答案。在此先感谢,理查德