i'm reading a c++ implementation of a connect 4 ai (minmax with alpha-beta pruning) by @balkarjun and ...
i love that they represented the board with just two u64 integers - one for each player. a bit is set to 1 where a player's piece has been dropped ...
(code available here: https://github.com/balkarjun/ConnectFourAI/)
and the win checking logic is just pure poetry. it checks one player at a time and does bit shifts that result in a non-zero value if and only if there are 4 pieces (four ones) in any of the winning directions.