
Library for the Nine Men's Morris game, supporting position creation, bot recommendations, and position evaluation. Features unit tests, code style analysis, and transposition hash maps.
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
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