File tree Expand file tree Collapse file tree 5 files changed +30
-26
lines changed Expand file tree Collapse file tree 5 files changed +30
-26
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ set -euo pipefail
23
3- cd $( git rev-parse --show-toplevel)
4-
5- if command -v stack & > /dev/null; then
6- SWARM=" stack exec swarm --"
7- else
8- SWARM=" cabal run -j -O0 swarm --"
9- fi
4+ cd " $( git rev-parse --show-toplevel) "
105
116for tutorial in $( cat scenarios/Tutorials/00-ORDER.txt | xargs) ; do
127 echo -n " $tutorial "
13- $SWARM -i " scenarios/Tutorials/$tutorial " --autoplay --cheat;
8+ scripts/play.sh -i " scenarios/Tutorials/$tutorial " --autoplay --cheat;
149 echo -en " \tCONTINUE [Y/n]: "
15- read answer;
10+ read -r answer;
1611 case " ${answer: 0: 1} " in
1712 n|N )
1813 exit 1
Original file line number Diff line number Diff line change 1- #! /bin/bash -ex
1+ #! /usr/bin/env bash
2+ set -euo pipefail
23
3- cd $( git rev-parse --show-toplevel)
4+ cd " $( git rev-parse --show-toplevel) "
45
56# NOTE: There are several executables within the swarm.cabal project.
67# If you only want to play the swarm game, you should specify an explicit
7- # target 'swarm:exe:swarm' to the 'stack ' command, to avoid building
8+ # target 'swarm:exe:swarm' to the 'cabal ' command, to avoid building
89# extra dependencies.
9-
10- cabal build -j -O0 swarm:exe:swarm
10+ cabal build -j --semaphore swarm:exe:swarm
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- #! /bin/bash -ex
1+ #! /usr/bin/env bash
2+ set -euo pipefail
23
3- cd $( git rev-parse --show-toplevel)
4+ cd " $( git rev-parse --show-toplevel) "
45
5- # This compiles without optimizations and then runs the resulting executable.
6- # It's been observed in certain versions of GHC that compiling with optimizations
7- # results in the swarm UI freezing for a potentially long time upon starting a scenario.
8- # See https://github.com/swarm-game/swarm/issues/1000#issuecomment-1378632269
9- scripts/build-game.sh && cabal run -j -O0 swarm:exe:swarm -- " $@ "
6+ # This compiles with optimizations and then runs the resulting executable.
7+ # Building with optimizations takes longer, but is noticeable when running
8+ # scenarios with swarms of robots.
9+ cabal run -j --semaphore swarm:exe:swarm -- " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -xeuo pipefail
3+
4+ cd " $( git rev-parse --show-toplevel) "
5+
6+ # This compiles the dependencies with optimizations (as they are not built frequently)
7+ # and then builds the swarm executable without optimizations.
8+ # Expect the game to run slow with many robots, but most scenarios are fine.
9+ # This is the development workflow when making changes to the game.
10+
11+ cabal build -j --semaphore swarm:exe:swarm --dependencies-only
12+ cabal run swarm:exe:swarm -O0 -- " $@ "
13+
14+ # PS: Don't forget to also run tests and at least build benchmarks or the CI will catch you ;)
You can’t perform that action at this time.
0 commit comments