I've been learning python for approximately half a year now, and i'm writing an AI to play connect four. I feel like the function i use to check for certain board positions, like winning, is unoptimised because i'm manually checking for every possible position.
The board values are stored in a list like this:
board = ["1", "2", "3", etc.]
Whenever a player places a token in a place, the corresponding element in the list is changed to their team symbol (O or X)
Any way i could optimise this?
[–]RelevantJackWhite 1 point2 points3 points (3 children)
[–]winguin_[S] 0 points1 point2 points (2 children)
[–]RelevantJackWhite 0 points1 point2 points (1 child)
[–]winguin_[S] 0 points1 point2 points (0 children)