Skip to content

Commit c8aaea7

Browse files
Use .values instead of .items
1 parent ed90dc3 commit c8aaea7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

starter/bot_logic/bot.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
class Bot:
77
"""
88
Your Bomberjam bot.
9-
NAME and compute_next_action(state) are required and used by the game loop.
10-
The rest is up to you!
9+
NAME should be your bot name. It cannot contain spaces or special characters.
10+
compute_next_action(state) should return an Action given a state.
11+
You can also add anything you need!
1112
"""
12-
NAME = "Guid"
13+
NAME = "MyBot"
1314

1415
def __init__(self, bot_id):
1516
self.bot_id = bot_id

starter/models/state.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class State(JSONSerializable):
1515
tiles: Represents the map in a numpy array. You can access any Tile with state.tiles[x, y]
1616
tick: The current game tick
1717
is_finished: whether or not the game is finished
18-
players: A dict with all players in the game. The keys are the player ids
19-
bombs: A dict with all bombs in the game. The keys are the bomb ids
20-
bonuses: A dict with all bonuses in the game. The keys are the bonus ids
18+
players: A list with all players in the game
19+
bombs: A list with all bombs in the game
20+
bonuses: A list with all bonuses in the game
2121
width: The width of the map
2222
height: The height of the map
2323
sudden_death_countdown: When the sudden death countdown reaches 0, the sudden death starts
@@ -36,9 +36,9 @@ def __init__(self, state_string, current_player_id):
3636

3737
self.tick = json_state["tick"]
3838
self.is_finished = json_state["isFinished"]
39-
self.players = [Player(player_json) for _, player_json in json_state["players"].items()]
40-
self.bombs = [Bomb(bomb_json) for _, bomb_json in json_state["bombs"].items()]
41-
self.bonuses = [Bonus(bonus_json) for _, bonus_json in json_state["bonuses"].items()]
39+
self.players = [Player(player_json) for player_json in json_state["players"].values()]
40+
self.bombs = [Bomb(bomb_json) for bomb_json in json_state["bombs"].values()]
41+
self.bonuses = [Bonus(bonus_json) for bonus_json in json_state["bonuses"].values()]
4242
self.width = json_state["width"]
4343
self.height = json_state["height"]
4444
self.sudden_death_countdown = json_state["suddenDeathCountdown"]

0 commit comments

Comments
 (0)