CMPUT 355 software to solve puzzles and play games.
- (optional?) Create a new virtual environment and activate the environment
virtualenv -p python3 venv
source venv/bin/activate- (optional?) Navigate to the lib directory and install the requirements
cd lib
pip install -r requirements.txt- Maze traversal
- Sliding tiles
- Tic-tac-toe
- Nim
- Hex
- Go
- Uniform random game player
- Minimax game tree search
- Monte-Carlo tree search
- Breadth-first search
- Depth-first search
- A* search
- A Python3 interpreter (both CPython and PyPy are supported)
virtualenv(Optional)make(Optional)
- Run
makein the project's root directory. This will first create a Python virtual environment withvirtualenvwhere the project and its Python dependencies will be installed, then install he project and its dependencies.- If installing without
virtualenv, runmake installwith thePIPargument, specifying a different instance ofpipthat will be used to install the project and its dependencies. For example, if you have PyPy installed to~/.pypy, then a command likemake install PIP=~/.pypy/bin/pipwould install this project and its dependencies for use with PyPy. - If installing without
make, seeMakefileandlib/Makefilefor more details on the commands thatmake installwould run and run analogous commands manually.
- If installing without
- Run tests with
make testin the project root orlib.
For Hex and tic-tac-toe. To see usage run:
bin/gpa-games-cli -hExample usage (here, Hex with the MCTS agent):
bin/gpa-games-cli hex mctsThen, type help to get a list of available commands.
For sliding tile puzzles. To see usage run:
bin/gpa-puzzles-cli -hExample usage (solvable sliding tile with A*):
bin/gpa-puzzles-cli solvable_sliding_tile "A*"Then, type help to get a list of available commands.
For hex:
python3 web/hex/application.pyFor puzzles:
python3 web/puzzles/application.pyThen, visit http://127.0.0.1:5000/ in your browser to access the GUI.
Help:
python3 tournament/play_tournament.py -hExample usage (MCTS hex player versus random hex player):
python3 tournament/play_tournament.py "bin/gpa-games-cli hex mcts" "bin/gpa-games-cli hex random"