Tris


Tris is a Tic-Tac-Toe player which learns from its mistakes

Code


Tris.py stores the moves of each match in a .json file, like this:

    {
        "69": ["1", "3", "4", "2", "7", null, null, null, null, false]
    }
            

The matches storage is better explained here in the Wiki

Usage


Tris.py can be simply used to play Tic-Tac-Toe against AI


Here's an example of a game


The code will be improved, adapted and optimized only on GitHub, the changes won't be uploaded to PyPI


As of december 2024, after over three years, the project has been improved: ANSI colors have been introduced and the code has been better formatted

The engine was only slightly improved in this occasion... but this is very niche among my side projects and will probably stay buried for another three years

Download


You can get the .zip of the latest version here


You can get the main file clicking here

Made with and GitHub Pages