Crates.io | bruto |
lib.rs | bruto |
version | 0.1.0 |
source | src |
created_at | 2022-07-10 15:14:50.661954 |
updated_at | 2022-07-10 15:14:50.661954 |
description | Artificial opponent to play the board game Quarto |
homepage | |
repository | https://github.com/mkovaxx/bruto |
max_upload_size | |
id | 623170 |
size | 27,172 |
Bruto is an artificial opponent to play Quarto.
Type swap
and hit ENTER after starting the program. This tells the engine to make the first move, and will let you see an example move and display the board.
The prompt player>
is displayed when it's your turn to enter a command or a move.
The following commands are supported:
exit
- exit the programswap
- switch sides with the opponentplay <ENGINE_NAME>
- select an engine as opponent
bruto
- (the default) engine based on MCTSrando
- engine that plays random movesAny input that isn't a valid command is assumed to be a move.
A move is encoded by a sequence of 6 characters of the form RCPPPP
, where R
stands for a lowercase character a..d
encoding a row, C
stands for a digit 1..4
encoding a column, and P
is either o
or x
encoding a choice for a binary property.
The RC
part of the move encodes the spot where the piece chosen in the previous turn is to be placed. In the first move of a game, there is no chosen piece yet, which is represented by RC
=..
.
The PPPP
part of the move encodes the piece which the opponent must place in the next turn. If the current move results in an end state (win/loss/draw), there is no such piece, which is represented by PPPP
=....
.