Skip to content

Commit

Permalink
Refactor code for checking the Zelda ROM
Browse files Browse the repository at this point in the history
  • Loading branch information
msosav committed Aug 5, 2024
1 parent 419d1f0 commit db12646
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions config/gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ def __init__(self, config: dict, debug=False):
self.rom_path = config['rom_path']
self.state_path = config['state_path']

try:
self.pyboy = PyBoy(self.rom_path)
except (FileNotFoundError):
raise SystemExit("You should have your ROM in the roms/ folder")
assert self.rom_path is not None, "ROM path is required"

self.pyboy = PyBoy(self.rom_path)

self._fitness = 0
self._previous_fitness = 0
Expand Down

0 comments on commit db12646

Please sign in to comment.