-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathyour_agent.py
More file actions
42 lines (30 loc) · 1.01 KB
/
your_agent.py
File metadata and controls
42 lines (30 loc) · 1.01 KB
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
'''
This is your AGENT. It is technically random agent but this is yours
# PLEASE don't use any additional packages other than those provided below
'''
import time
import random
import numpy as np
class agent:
def __init__(self, player_num, env):
self.name = "a bot has no name" ###### give your bot a name ######
self.player_num = player_num
self.env = env
def give_next_move(self, solid_state):
'''
This method is called each time the player needs to choose an
action
solid_state: is a dictionary containing all the information about the board
'''
#transfering a single solid_state
self.board = solid_state["board"]
self.done = solid_state["done"]
self.bombs = solid_state["bombs"]
self.turn = solid_state["turn"]
self.player = solid_state["players"][self.player_num-1]
#############################
###### Your Code Here #######
actions =[0,1,2,3,4,5]
action = random.choice(actions)
#############################
return action