tech.lgbt is one of the many independent Mastodon servers you can use to participate in the fediverse.
We welcome all marginalized identities. This Mastodon instance is generally for folks who are LGBTQIA+ and Allies with an interest in tech work, academics, or technology in general.

Server stats:

2.9K
active users

i'm reading a c++ implementation of a connect 4 ai (minmax with alpha-beta pruning) by @balkarjun and ...

Public

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: github.com/balkarjun/ConnectFo)

Public

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.
:blobcatmelt: