Engine

class draughts.engine.Engine[source]

Interface for engine compatible with Server class.

abstract get_best_move(board: Board) Move[source]

Returns best move for given board. It could be random move, or move calculated by some algorithm.

to get list of legal moves use board.legal_moves

class draughts.engine.AlphaBetaEngine(depth)[source]

Engine using alpha-beta puring algorithm. Alpha-beta puring is a minimax algorithm with optimization. Algorithm will not inspect nodes that are worse than already inspected nodes. Additionaly, this engine will inspect capture moves first. Usually, those moves are better than non-capture moves.

__init__(depth)[source]

depth - how many moves will be inspected by engine. Bigger depth means better moves, but also longer calculation time.

evaluate(board: Board)[source]

Simple evaluation function for given board.