Reading List

The Selfish Gene
The Psychopath Test: A Journey Through the Madness Industry
Bad Science
The Feynman Lectures on Physics
The Theory of Everything: The Origin and Fate of the Universe


ifknot's favorite books »

Tuesday 9 May 2017

Tic-Tac-Toe Bitboards


CPE1704TKS

Board Games are, generally speaking, a collection of position based states and whilst it might seem intuitive for games like draughts, othello, chess, etc to have their positional states encoded in arrays and matrices of integers or floats it isn't efficient and it certainly isn't easy to reason about those states. So, quite early on (1950s and 1960s) it was discovered, and rediscovered, that it is more efficient to represent game states as 1 dimensional collections of bits and, more importantly, much easier and faster to reason about those states using boolean operators.

Such 1D bit arrays are termed bitboards and reach their zenith of complexity and utility in the game of Chess.

But it's not just Chess that can benefit from bitboards so can the humble game of Tic-Tac-Toe (a.k.a. Noughts & Crosses if you're Blighty based).