Skip to content

coding challenge: Create an app that can interactively play the game and never lose.

Notifications You must be signed in to change notification settings

rajasekaran86/Tic-Tac-Toe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

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

About

coding challenge: Create an app that can interactively play the game and never lose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.6%
  • CSS 1.4%