/t3arena

An interface allowing a humans to play games using libmorris locally in a window-managed environment.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

T3Arena

A window-managed client for playing tic-tac-toe versus a computer opponent via the libmorris backend.

Description

This application is a proof-of-concept client that implements an interface to the libmorris backend. It is intended to provide a working example of very simple, single game use of libmorris. The application features a resizable window with scaling graphics regardless of size. It allows a human player to play against the libmorris-provided AI with the human receiving the first move. Upon completion of a game, rematches can be subsequently played by following the onscreen prompt.

Installation / Setup

The repository can be cloned locally by running:

git clone https://github.com/JamesChristie/t3arena.git

The repository includes a .python-version file to indicate the version of Python that was used during development. Other versions may work, but it would be best to check that file in your local version to ensure you have the same version available. By default, pyenv will automatically load the correct, installed version into the current $PATH when you enter the directory.

Requirements

I have not extensively tested this application on anything other than my personal machine. The only dependency that should be needed is the appropriate OpenGL libraries for your operating system. Hardware acceleration is not required, a software implementation, so long as the libs are in your PATH, should work just fine.

Running the Test Suite

The provided Makefile includes tasks for most, if not all, common functions provided for managing the source code.

  • Installing Dependencies

The provided init make task will install requirements for the test suite.

make init
  • Executing Tests

There are two ways to execute the provided tests. The make task is highly recommended as it also runs linting of all code (and tests as well). Tests are executed via the normal unittest discovery as laid out in pyspec.sh.

# Execute tests and lint code
make dev

# Execute tests, skipping code checks
./pyspec.sh

Usage

The client can be executed on any system with a working install of OpenGL libraries by simply running the included t3arena.py file.

Contributing or Modifying

Getting set up to modify or contribute to the codebase is as easy as forking the repository, stepping through the provided setup instructions, and then (optionally) opening a pull request on Github once your changes are done and tests are passing.

Building a Python Egg

A distributable version of this library, complete with setup.py file can be generated by running:

make