diff --git a/minigrid/envs/doorkey.py b/minigrid/envs/doorkey.py index 39724968f..43c07f840 100644 --- a/minigrid/envs/doorkey.py +++ b/minigrid/envs/doorkey.py @@ -91,7 +91,7 @@ def _gen_grid(self, width, height): self.place_agent(size=(splitIdx, height)) # Place a door in the wall - doorIdx = self._rand_int(1, width - 2) + doorIdx = self._rand_int(1, height - 2) self.put_obj(Door("yellow", is_locked=True), splitIdx, doorIdx) # Place a yellow key on the left side