Beispiel #1
0
    def test_placement_1(self):
        player_list = ["red","white"]
        b = [[1,2,3,2],[4,0,5,1],[1,1,0,4]]

        ex_board = f.FishBoard(3,4)
        ex_board.createBoard(exact=b)

        ex_peng_map = {"red":[(0,0),(1,0),(2,0)], "white":[(3,2),(3,1),(0,2)]}
        ex_state = s.State(ex_board,player_list, ex_peng_map, {"red":0,"white":0}, "red", "Moving")

        red_strat = BestStrategy()
        placement = red_strat.place_penguin(ex_state)
        self.assertEqual(placement, ("Placement", (3,0)))
Beispiel #2
0
    def test_move_2(self):
        player_list = ["red","white"]
        b = [[1,2,3,2],[4,0,5,1],[1,1,0,4]]

        ex_board = f.FishBoard(3,4)
        ex_board.createBoard(exact=b)

        ex_peng_map = {"red":[(0,0),(1,0),(2,0),(3,0)], "white":[(3,2),(3,1),(0,2),(0,1)]}
        ex_state = s.State(ex_board,player_list, ex_peng_map, {"red":0,"white":0}, "red", "Moving")

        strat = BestStrategy()
        move = strat.move_penguin(ex_state,4)

        self.assertEqual(move, ('Move', (2, 0), (2, 1), 'red'))
Beispiel #3
0
 def strategy(self):
     _strategy = BestStrategy()
     _strategy.set_working_directory(self._working_directory)
     return _strategy
Beispiel #4
0
 def __init__(self):
     self.strategy = BestStrategy()