Skip to content

Commit b36c742

Browse files
committed
WIP
1 parent 3018aaa commit b36c742

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

pelita/game.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def setup_game(team_specs, *, layout_dict: Layout, max_rounds=300, rng=None,
355355
'food': food,
356356

357357
#: Food ages per team. Dict of (int, int) to int
358-
'food_age': ({}, {}),
358+
'food_age': [{}, {}],
359359

360360
### Round/turn information
361361
#: Phase
@@ -381,10 +381,10 @@ def setup_game(team_specs, *, layout_dict: Layout, max_rounds=300, rng=None,
381381
'score': [0, 0],
382382

383383
#: Fatal errors
384-
'fatal_errors': ([], []),
384+
'fatal_errors': [[], []],
385385

386386
#: Number of timeouts for a team
387-
'timeouts': ({}, {}),
387+
'timeouts': [{}, {}],
388388

389389
### Configuration
390390
#: Maximum number of rounds, int
@@ -411,10 +411,10 @@ def setup_game(team_specs, *, layout_dict: Layout, max_rounds=300, rng=None,
411411
### Informative
412412

413413
#: Name of the teams. Tuple of str
414-
'team_names': team_names,
414+
'team_names': list(team_names),
415415

416416
#: Additional team info. Tuple of str|None
417-
'team_infos': team_infos,
417+
'team_infos': list(team_infos),
418418

419419
#: Time each team needed, list of float
420420
'team_time': [0.0, 0.0],

pelita/spec.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ class Layout(TypedDict):
1717
class GameState(TypedDict):
1818
walls: set[Pos]
1919
shape: Shape
20-
food: tuple[set[Pos], set[Pos]]
21-
food_age: tuple[FoodAges, FoodAges]
20+
food: list[set[Pos]]
21+
food_age: list[FoodAges]
2222
game_phase: Literal["INIT", "RUNNING", "FAILURE", "FINISHED"]
2323
turn: None|int
2424
round: None|int
2525
gameover: bool
2626
whowins: None|int
2727
bots: list[Pos]
2828
score: list[int]
29-
fatal_errors: tuple[list[Any], list[Any]]
30-
timeouts: tuple[Any, Any]
29+
timeouts: list[Any]
30+
fatal_errors: list[list[Any]]
3131
max_rounds: int
3232
timeout_length: int
3333
initial_timeout: int
3434
noise_radius: int
3535
sight_distance: int
3636
max_food_age: float|int
3737
shadow_distance: int
38-
team_names: tuple[None|str, None|str]
39-
team_infos: tuple[None|str, None|str]
38+
team_names: list[None|str]
39+
team_infos: list[None|str]
4040
team_time: list[float]
4141
deaths: list[int]
4242
kills: list[int]

test/test_game.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,6 @@ def move(b, s):
10101010
def test_non_existing_file():
10111011
l = maze_generator.generate_maze()
10121012
res = run_game(["blah", "nothing"], max_rounds=1, layout_dict=l)
1013-
print(res['fatal_errors'])
10141013

10151014
# We might only catch only one of the errors
10161015
assert len(res['fatal_errors'][0]) > 0 or len(res['fatal_errors'][1]) > 0

0 commit comments

Comments
 (0)