This is a tic tac toe game made using Python with PyGame for the game structure and Prolog to define the behavior of the actor that plays the game along with the user.
- PyGame >= 2.1.2
- PySwip >= 0.2.10
- SwiProlog >= 8.4.2
On Linux, the dependencies can be installed with the following commands:
sudo apt update
sudo apt install swi-prolog python3-pygame python3-pip
Some python libraries should also be installed before running the software, it is recommended that you install and configure anaconda, and create a virtual environment to install the following dependencies inside:
conda create -n ttt python=3.10
conda install -n ttt -c conda-forge libstdcxx-ng
conda run -n ttt pip install pyswip==0.3.1
conda run -n ttt pip install pygame
If conda run -n ttt pip install pyswip==0.3.1
did not work you can try using conda run -n ttt pip install git+https://github.com/yuce/pyswip@master#egg=pyswi
instead.
After installing the dependencies (inside the conda env) execute the program with:
conda run -n ttt python3 main.py
For basic debugging there exists two basic debug levels:
-
Describes each action suggested at each move of the player
DEBUG=1 python3 main.py
-
Describes eventual exceptions that occurred during the execution of the program (it also includes 1)
DEBUG=2 python3 main.py
- Russell, Stuart, et, Norvig, Peter, "Artificial Intelligence A Modern Approach", 4th Edition
- Lalanda, Philippe, “Two complementary patterns to build multi-expert systems”, Thomson-CSF Corporate Research Laboratory
- 6. Search: Games, Minimax, and Alpha-Beta by MIT OpenCourseWare on YouTube
- Coding Tic Tac Toe in Python with Pygame by Coder Space on YouTube
- Pilgrim, A. Robert, "TIC-TAC-TOE: Introducing Expert Systems to Middle School Students", Dept. of Computer Science and Information Systems, Murray State University