Coder Social home page Coder Social logo

anaximeno / tictactoes Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 58 KB

A tic-tac-toe game with a built-in expert system that plays the game with the user

License: MIT License

Python 76.56% Prolog 23.44%
artificial-intelligence prolog pygame python

tictactoes's Introduction

Tic Tac Toe Game

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.

Dependencies

  • PyGame >= 2.1.2
  • PySwip >= 0.2.10
  • SwiProlog >= 8.4.2

Installing Dependencies

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 git+https://github.com/yuce/pyswip@master#egg=pyswip
conda run -n ttt pip install pygame

If conda run -n ttt pip install git+https://github.com/yuce/pyswip@master#egg=pyswi did not work you can try using conda run -n ttt pip install pyswip instead.

Executing the Program

After installing the dependencies (inside the conda env) execute the program with:

conda run -n ttt python3 main.py

Basic Debugging

For basic debugging there exists two basic debug levels:

  1. Describes each action suggested at each move of the player

    DEBUG=1 python3 main.py
  2. Describes eventual exceptions that occurred during the execution of the program (it also includes 1)

    DEBUG=2 python3 main.py

References

  • 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

tictactoes's People

Contributors

anaximeno avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.