Относительно второй до последней строки я получаю сообщение об ошибке:
''tuple' object has no attribute 'add''
, но я подумал, что это набор, а не кортеж. Пожалуйста, сообщите
EMPTY = None
board = [[EMPTY, EMPTY, EMPTY],
[EMPTY, EMPTY, EMPTY],
[EMPTY, EMPTY, EMPTY]]
actions = ()
print(type(actions))#create code to build tuple with all possible moves
for x in range(3):
for y in range(3):
if board[x][y] is None:
# add x,y to actions as a single set
actions.add((x,y))
print(actions)