Welcome, this is a ten week Python based project with the purpose of creating an Artificial intelligence (AI) to play the classical game Quoridor
The abstract strategy game, Quoridor, is one that can be played with two to four player(s). Quoridor even though it is a game of simple rules it is surprisingly a deep and strategic game. The whole object of the game is to advance your pawn to the opposite edge of the board.
As mentioned the objective of Quoridor is to advance your pawn to the opposite end of the board. With each turn, a player is given two decisions: move their pawn or place a wall. The standard setup of the game is two players each with ten walls. In turn, players can choose whether to move their pawn by one space Up,Down,Right,Left (no diagonals); or place a wall anywhere on the board. Pawns have to maneuver around walls with of course the end goal being to get to the other side.
This project was written in Python using the platform Eclipse. This project was not completely from scratch for a GUI was provided for visual representation and checking. The rest was written by me from scratch.
~ One board with 81 squares
~ Two storage slots for walls
~ Each player starts off in the center of this base line (Fig. 1)
~ Each player in turn, chooses to move his/her pawn or to put up one of his/her wall
~ When a player runs out of walls, the player must move his/her pawn.
~ The pawns are to move one square at a time (Fig. 2)
~ Pawns must get around walls (Fig. 3)
~ The walls must be placed between 2 sets of 2 squares (Fig. 4)
~ No wall is to completely seal off a player's end goal line. One slot must be open at all times (Fig. 5)
~ When two players are face to face on a neighboring squares and not separated by a wall, the player whose turn it is can jump said opponent's pawn, thus advancing an extra square. (Fig. 6)
~ If there is a wall behind the said pawn, the player can place his pawn to the left or the right of the other pawn. (Fig. 8/9)
The first player who reaches one of the 9 squares opposite his base line is the winner (Fig. 7)
From 10 to 20 minutes.
1) Download Zip or Tar (MohDar_Quoridor)
2) Exact downloaded file
3) Within the exacted folder are a few files looking similar to the image below:
4) Best method to run the Quoridor's engine is through Eclipse Classic
5) Once Eclipse is installed if you do not have the PyDev Python Plugin go to the below section:
a. Installing Python Plugin
b. PyDev Configuration
c. PyDev Handle
6) Create a new Python project with the following setup
I. For "Grammar Version" select: 3.0
II. For "Interpreter" select the name of the Python 3.X
III. Unselect the checkbox for "Create default src folder...".
IV. Click the "finish" button
7) Drag the exacted folder to the newly created project, you will see something similar to the below:
8) Now in StudentPlayers, you will find the directory called MohDar13. This is where all the AI and good stuff is.
Edit the config.txt in the project to your liking, the following are common edit areas:
a. API_KEY ~ There is my personal API Key please be respectful of this fact (e4cda5d2ce6df460c13)
b. PLAYER_MODULES Important area for selecting the AIs (Possible Choices: Human,OKComputer,BeatMe, and my module MohDar13)
c. PRE_MOVE ~ Area for moves to be made before players get control
d. NUM_WALLS ~ Wall count for players - Currently set for {1:20,2:10,4:5} meaning with 2 players each player gets 10 walls. If 4 players each player gets 5 walls.
e. ANIMATION_SPEED ~ Unit is in milliseconds between successive moves
The current config is set for my module (MohDar93) to versus another AI (BeatMe)
To run simply right click on quoridor.py and click Run As - Python Run
Enjoy and Give Credit where it is do.
Credit: UI Creator: Adam Oest
Created and Property of Mohammad M. Daraghmeh