I tried making the minimax algorithm. Not really sure how to explain how it works... you could try googling it, though. Only 88 blocks!
Could be used in noughts and crosses?