3 ms·
Bitboards and Connect Four
- tromp 3y agoMy connect-4 page [1] also links to this comprehensive explanation. [1] https://tromp.github.io/c4/c4.html https://tromp.github.io/c4/c4.html
- missblit 3y agoI used a similar technique in a university class. We were doing a Connect 4 bot tournament, and I wanted mine to be as optimized as possible. But in the end I spent all my time playing around with bitwise operations, so had no time left to add in multiple threads (so couldn't was slowed down by a factor of 4 or so) timing (so had to cut off the search early to not accidentally go over the limit), or to tweak the score heuristic. Which meant my program only got second place. Still, I think the teacher enjoyed it, and there were some oohs and aahs when my program output moves basically instantly during the tournament.
- NoboruWataya 3y agoAs I understand it, chess engines generally do something similar, taking particular advantage of the fact that chess boards are 8x8 in size.
- divbzero 3y agoReminds me of a similar write-up about hexagonal grids posted to HN 10+ years ago: https://news.ycombinator.com/item?id=5809724 https://news.ycombinator.com/item?id=5809724