Skip to content

Commit

Permalink
Env creation tutorial 2 : grid size inconsistent (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandDecoster authored Jul 25, 2023
1 parent d81c1cb commit 83d243c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tutorials/EnvironmentCreation/tutorial2_adding_game_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def reset(self, seed=None, options=None):
self.prisoner_x = 0
self.prisoner_y = 0

self.guard_x = 7
self.guard_y = 7
self.guard_x = 6
self.guard_y = 6

self.escape_x = random.randint(2, 5)
self.escape_y = random.randint(2, 5)
Expand Down Expand Up @@ -104,7 +104,7 @@ def step(self, actions):
return observations, rewards, terminations, truncations, infos

def render(self):
grid = np.zeros((7, 7))
grid = np.full((7, 7), " ")
grid[self.prisoner_y, self.prisoner_x] = "P"
grid[self.guard_y, self.guard_x] = "G"
grid[self.escape_y, self.escape_x] = "E"
Expand Down

0 comments on commit 83d243c

Please sign in to comment.