Exemple #1
0
    def test_weight2Enemy(self):
        initpos = (1,1)
        direction = (1,0)
        board = {(1,3):'X',(1,4):'O',(1,6):'O'}
        state = Struct(to_move= 'X',
                      utility=0,
                      board=board, moves=[], realPlayer='X')

        self.assertEqual(h.lineWeight(state, initpos, direction, placedcellsmultiplier=4), -8)
Exemple #2
0
    def test_diagonal(self):
        initpos = (1,5)
        direction = (1,-1)
        board = {(5,1):'O',(4,2):'X'}
        state = Struct(to_move= 'X',
                      utility=0,
                      board=board, moves=[], realPlayer='O')

        self.assertEqual(h.lineWeight(state, initpos, direction, placedcellsmultiplier=4), -4)
Exemple #3
0
    def test_weightVoidLine(self):
        initpos = (1,1)
        direction = (1,0)
        board = {}
        state = Struct(to_move= 'X',
                          utility=0,
                          board=board, moves=[], realPlayer='X')

        self.assertEqual(h.lineWeight(state, initpos, direction, placedcellsmultiplier=4),0)