swarm/app
Karl Ostmo 5165b576ae
Introduce autoplay flag (#792)
This PR introduces an `--autoplay` flag that causes the solution stored in the `solutions` field of a scenario file (which was selected on the command line via the `--scenario` option) to be automatically run when the game starts, identically to the `--run` option.

The purpose is to:
1. more easily showcase scenarios to the community
2. facilitate a quick a sanity check that the solution text in the yaml file is correct

# Test procedure

    stack run -- --scenario data/scenarios/Tutorials/conditionals.yaml --autoplay

This has the same effect as manually copying the solution stored in `conditionals.yaml` to `myfile.sw`, and then running:

    stack run -- --scenario data/scenarios/Tutorials/conditionals.yaml --run myfile.sw

<a href="https://asciinema.org/a/mGB5VDKhsLLPdrItZWi3qsHUV" target="_blank"><img src="https://asciinema.org/a/mGB5VDKhsLLPdrItZWi3qsHUV.svg" width="640" /></a>
2022-10-28 04:47:18 +00:00
..
Main.hs Introduce autoplay flag (#792) 2022-10-28 04:47:18 +00:00