I'm trying to refactor some logic that I have in a script of mine, which used to be a bunch of nested IF statements.
It will essentially iterate through a user-chosen column (pick) of a 2D array to find an empty value (denoted by a period placeholder here) and insert a symbol depending on a certain condition.
next((x for x in board[x][pick] if board[x][pick] != "."), fullCols.append(pick))
board[x][pick] = symbol
On the first line, it will fail because it will say list index out of range. The 2D array was initialized to seven columns and six rows.
Any help?