This project provides a library for a game called "Nine mens morris"
New game position is created using position class
val piecePlacements = arrayOf(
GREEN, EMPTY, EMPTY,
BLUE_, EMPTY, EMPTY,
EMPTY, BLUE_, EMPTY,
EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
EMPTY, EMPTY, EMPTY,
EMPTY, EMPTY, EMPTY,
EMPTY, EMPTY, EMPTY
)
Position(
positions = piecePlacments,
greenPiecesAmount = 4u,
bluePiecesAmount = 2u,
pieceToMove = false,
removalCount = 1u
)
warning it is recommended not to touch greenPiecesAmount/bluePiecesAmount, they are used for calculations speed up breaking there functionality may lead to hardly debuggable behaviour
to get bot recommendation you can use
Position.solve(depth)
first element of the pair is final position evaluation (note: it is always calculated for green pieces) and second one is winning move sequence (note: the first move is the last one in the sequence)
Project progress
- write unit tests
- use code style analyser
- create a better hash function
- reuse piece count data
- create transposition hash map
- implement alpha-beta pruning (and move ordering)
- implement NNUE position evaluation
- create a table base of all possible moves (since there isn't as many positions as in chess)
- reuse hash calculations
- reuse possible moves generation