Bot Strategy

Here are some suggestions of strategies to improve your bots performance. (There isn't much strategy to noughts and crosses though.)

Sort out your priorities

Randomly choosing your moves probably won't get you very far. Try checking for certain patterns on the board and react accordingly, similar to the case study on our Adding Intelligence To Your Bot page. A good starting set of priorities is to check whether you can win, then check whether you can stop yourself from losing, then check whether you can move to the centre, followed by corners, and finally edges.

A solved game

Noughts and crosses is a solved game and there is a perfect strategy, you can hard code this strategy if you know what it is. If you are feeling a little more adventurous however, you could try creating a minmax algorithm that will play the game perfectly every time.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License