It is an embryo of a multi-agent draughts program, for starters, that I initially began with the aim of learning Scala and experimenting with AI.
Since in its current state it eschews all imaginable sorts of optimizations and the architecture is trivially simple on purpose, it also makes for a neat playground for experimenting with AI yourself.
The architecture is extensible and modular enough (see Game.scala
)
that you can recycle it to implement your own two-player, perfect
information game with a minimum of effort; an example can be found in
extras/StupidGame.scala
.
Conversely, you can easily add an engine by implementing an AI[G:< Game[G]
or even an evaluation function for the existing engines
(e.g. by extending trait MinimaxEvaluation
) with ease.
The engines (currently found under ai/
) currently consist of a
simple textbook implementation of Minimax with Alpha-Beta pruning and
MTCS.
Scala is especially handy in that it allows the programmer to mix pure functional programming with structured programming, thus allowing for copying and pasting algorithms found in literature verbatim.
Nota bene: at the moment the gaming board comes with one
simplification wrt the WDCF rules: a draw is
had after n
moves, with n
set to 100
by default.
Available here.
sbt runMain "HumanVsMTCS"
or
sbt runMain "HumanVsMinimax"
to play a game vs the MTCS resp. Minimax engine with the default parameters, in which you play Max, i.e. White.
There is also a handful of horribly quick&dirty benchmarks under
benchmarks/
.
No.
Not at all.
Not yet.
A resounding yes.
Yes, as long as you comply with the GPLv3.
https://en.wikipedia.org/wiki/Minimax
https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
- Tobia Tesan - tobiatesan
This project is licensed under the GPLv3 License - see the LICENSE.md file for details