Skip to content

Commit

Permalink
Merge pull request #354 from MarcCote/add_seed_tw_play
Browse files Browse the repository at this point in the history
Add seed tw play
  • Loading branch information
MarcCote authored Sep 27, 2024
2 parents 9100860 + 7b82a07 commit e62b90d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/tw-play
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def build_parser():
choices=["random", "human", "random-cmd", "walkthrough"],
help="Select an agent to play the game: %(choices)s."
" Default: %(default)s.")
parser.add_argument("--seed", type=int, metavar="SEED",
help="Random seed for the game.")
parser.add_argument("--max-steps", type=int, default=0, metavar="STEPS",
help="Limit maximum number of steps.")
parser.add_argument("--viewer", metavar="PORT", type=int, nargs="?", const=6070,
Expand All @@ -38,6 +40,7 @@ def main():
args.verbose = args.very_verbose

env = textworld.start(args.game)
env.seed(args.seed)

if args.mode == "random":
agent = textworld.agents.NaiveAgent()
Expand Down

0 comments on commit e62b90d

Please sign in to comment.