Forward-porting to Python 2.6 exposed a bug.
[super-star-trek.git] / src / 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 if [ $1 ]
9 then
10     head -n `expr $1 + 2` </usr/tmp/sst-input.log >replay.log
11 else
12     mv /usr/tmp/sst-input.log replay.log
13 fi
14 python sst.py -t -r replay.log