예제 #1
0
    def change_turn(self, selected, square):
        opening = ''.join([
            p0x88_to_chess_notation(tuple_to_0x88(selected)),
            p0x88_to_chess_notation(tuple_to_0x88(square))
        ])
        self.selected = None
        self.fail = None

        if hasattr(self.current_player, 'openings'):
            if self.current_player.openings:
                try:
                    self.current_player.openings = self.current_player.openings[opening]
                except KeyError:
                    self.current_player.openings = {}

        self.other_player.end_turn()
        self.current_player.start_turn()
 def test_0x88_112_to_cn_A1(self):
     self.assertEqual(p0x88_to_chess_notation(112), "a1")
 def test_0x88_0_to_cn_A8(self):
     self.assertEqual(p0x88_to_chess_notation(0), "a8")