File size: 1,581 Bytes
afab5da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""NOTE : THIS IS THE FORMAT YOU SHOULD FOLLOW TO MAKE GAMES"""

class GAME:
    def __init__(self):
        self.row = 8
        self.col = 8
        self.possible_state = self.row * self.col

    def initialise_state(self):
        """NOTE: this fuction creates starting position for your game"""

    def get_valid_moves(self, state):
        """ NOTE: inputs state and output all possible valid moves"""

    def know_terminal_value(self, state, action):
        """NOTE: input state and action and the output will be tuple True 
        if is terminal state and False if not and value 0 is
        player lost and 1 if the player won the game"""

    def make_move(self, state, action, player):
        """NOTE: input a action and a state and a player, the 
        action is taken on given state and output is the final state"""

    def get_encoded_state(self, state):
        """input a state the output should be the encoded state that will be
        given to the neural network"""

    def get_opponent(self, player):
        """NOTE: taking the input of current player this should change the 
        player to the opponent"""
        return -1 * player

    def get_opponent_value(self, value):
        """this should switch the reward obtained from the know_terminal_state() 
        to the reward of the opponent"""
        return -1 * value

    def change_perspective(self, state, player = -1):
        """this function taking input state and player flip the board and return 
        the game with the perspective of the opponent"""
        return player * state