chessai.search.tourbase

 1import random
 2import typing
 3
 4import chessai.core.search
 5
 6def tour_base_search(
 7        problem: chessai.core.search.SearchProblem,
 8        heuristic: chessai.core.search.SearchHeuristic,
 9        rng: random.Random,
10        **kwargs: typing.Any) -> chessai.core.search.SearchSolution:
11    """
12    Output a very specific set of actions meant for the `tour-base` board.
13    This (fake) search will generally not work on other boards.
14    """
15
16    actions = [
17        chessai.core.action.from_uci('a1b3'),
18        chessai.core.action.from_uci('b3c5'),
19        chessai.core.action.from_uci('c5e6'),
20        chessai.core.action.from_uci('e6f4'),
21        chessai.core.action.from_uci('f4g6'),
22        chessai.core.action.from_uci('g6h8'),
23    ]
24
25    return chessai.core.search.SearchSolution(actions, 0.0)