Skip to content
No description or website provided.
Find file
Latest commit 9bfe5cf @mkristofik Add readme file.


Tic-Tac-Toe in Python
Michael Kristofik <>


This is a simple text-based tic-tac-toe game written in Python.  I wrote it so
I could experiment with AI algorithms in games.  Teaching a computer to play
tic-tac-toe *well* is surprisingly difficult without using a giant lookup table
(cf.  See for the algorithms I used.


    Play against the computer.  Human player goes first.
    Play against the computer.  Computer player goes first.
python [2]
    Computer plays against itself, a naive algorithm vs. a smarter algorithm.
    Naive player goes first.  Use the command-line argument 2 to let the smart
    algorithm go first.


Copyright Michael Kristofik 2011-2012.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
Something went wrong with that request. Please try again.