Install node: [https://nodejs.org/en/download/current]
Install Docker: [https://www.docker.com/]
Ensure Docker is running.
Download or git clone this repository. Open a terminal at its location and run the following:
- Install dependencies with the following command:
npm i
- Build with the following command:
npm run build
Note: On first start, select the Build Default Bots option. Once built, you will need to start again.
To start the CLI, enter the following command:
npm start
To quit at any point, hold ctrl+c
Note: In 'Begin Best Of', only the first 2 selected players will play
-
Choose type of game:
- Select which game you want to play (i.e. tictactoe or arboretum)
- Press
enterto select
-
Enter a unique tournament name:
- Type a unique tournament name or leave the default and press
enter.
- Type a unique tournament name or leave the default and press
-
Choose best of:
- Choose number of games to play and press
enter.
- Choose number of games to play and press
-
Which players?
- Random:
- Use only default random bots
- fromFile:
- Select a file (
enter) - Choose bots from file:
- Press
tabto select/deselect,ctrl + ato toggle all,enterto proceed
- Press
- Select a file (
- Random:
-
Message timeout (ms):
- The maximum time a bot can spend before it reaches a timeout and the server will play a random move on its behalf.
- Enter a value or use default and
enter.
-
User plays?
- play:
- Enter a name/user identifier
- don't play
- play:
-
Save?
- All matches will be saved to the tournamentResults directory.
Play a tournament by selecting 'Begin Tournament'.
The menu options are similar to 'Begin Best Of' but with some changes.
- Choose type of tournament:
- Round robin
- A league style tournament where every bot plays every other bot once
- Knockout
- A single chance tournament where bots are knocked out until one remains
- Round robin
- Number of players:
- Tournaments will fill up with the default random bots to reach the number of players required.
- Knockout tournaments will use the next largest power of 2
- Choose Seeding (Knockout tournament only):
- Random
- Use a randomly generated seeding
- Choose File
- Tournament results can be used as seeding, they are stored in
./tournamentResults
- Tournament results can be used as seeding, they are stored in
- Random
See the API documentation here: API
See the Bots documentation here: Bots
Environment Variables can unlock some additional functionality. The method of using environment variables depends on the environment:
KEY=VALUE npm startfor the majority of cases- This enables the variable for this
npm startcommand only and no following commands
- This enables the variable for this
$key=value; npm startfor powershell- This enables the variable for the process, and hence for all following commands.
- The
TIMEOUTenvironment variable is preset when the bot is launched by the server. - It contains the timeout limit for each move.
- Setting
DEBUGtotrueenables you to see both hands when playing against a bot.
- Setting
NOCOLOURtotruedisables thechalkmodule, and hence any colours.- Use if there are any issues with cards blending into backgrounds.