Exemplo n.º 1
0
    def move(self, move, evaluation, time_sec):
        """Tell the engine that all further commands relate to the position after the given move.
        The move is 2 characters e.g. "F5". Eval is normally in centi-disks. Time is in seconds.
        Eval and time may be omitted. If eval is omitted it is assumed to be "unknown";
        if time is omitted it is assumed to be 0.

        Required:Update the game state by making the move. No response required.
        """
        # logger.debug(f"[{move}] [{evaluation}] [{time_sec}]")

        action = convert_move_to_action(move)
        self.engine.move(action)
Exemplo n.º 2
0
def test_convert_move_to_action():
    eq_(0, convert_move_to_action("A1"))
    eq_(63, convert_move_to_action("H8"))
    eq_(44, convert_move_to_action("F5"))
    eq_(None, convert_move_to_action("PA"))