Address GitLab issue #1: Crash when issuing DOCK command next to inhabited planet
[super-star-trek.git] / replay
1 #!/bin/sh
2 # Replay the last SST game. With arg, use only that many lines of the log
3 #
4 # Because the replay log captures the random-number seed,
5 # repeating this any number of times should produce identical games,
6 # unless the code changes.
7 #
8 TMP=${TMPDIR:-/tmp}
9 if [ $1 ]
10 then
11     head -n `expr $1 + 2` <$TMP/sst-input.log >replay.log
12 else
13     mv $TMP/sst-input.log replay.log
14 fi
15 python sst.py -t -r replay.log