Skip to content
coding challenge: Create an app that can interactively play the game and never lose.
Branch: master
Clone or download
Pull request Compare This branch is 31 commits ahead, 25 commits behind coxmediagroup:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
TickyTack
README

README

DJTickyTack
===========

DJTickyTack is a Tic-Tac-Toe server built in python with Django.
Players can create or join any number of games, and play proceeds
asynchronously.

Although Tic-Tac-Toe is a rather silly application of this technology,
the software serves as prototype server for more advanced turn based
games, such as Chess, Checkers, or Go.

It provides both a rudimentary HTML interface and a RESTful API.

Requirements:
-------------

  python (developed with v 2.7)
  django (developed with v1.2.4)

  django-registration

Running the Server
------------------

To set up the database (only required before the first run):

  python manage.py syncdb

To start the server:

  python manage.py runserver localhost:8888

Then go to:

  http://localhost:8888/


MinMaxMoe
=========

MinMaxMoe implements the rules of tic tac toe and a complete brute-force
solution to the game based on the minimax algorithm from game theory. It
can play you interactively in the shell, or can be scheduled to play
asynchronously on a DJTickyTack server.


Setup
-----

MinMaxMoe uses a database of all possible lines of play. The game tree is
stored in 'gametree.dbm', which you must generate manually.

  # from TickyTack directory:
  python MinMaxMoe/gentree.py

On my low-end 2010 win64 laptop, this takes about two and half minutes and
generates a 4.5MB file. Your mileage may vary depending on CPU strength
and the anydbm modules you have configured in your python.

NOTE: You only need to do this *once*.
(See the docstrings in gentree.py for rationale.)


Running
-------

  # from TickyTack directory:
  python MinMaxMoe/play.py

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.