C files and associated autotools stuff moved to the c-version subdirectory.
[super-star-trek.git] / c-version / src / replay
diff --git a/c-version/src/replay b/c-version/src/replay
new file mode 100755 (executable)
index 0000000..9e5c196
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Replay the last SST game. With arg, use only that many lines of the log
+#
+# Because the replay log captures the random-number seed,
+# repeating this any number of times should produce identical games,
+# unless the code changes.
+#
+if [ $1 ]
+then
+    head -n `expr $1 + 2` </usr/tmp/sst-input.log >replay.log
+else
+    mv /usr/tmp/sst-input.log replay.log
+fi
+python sst.py -t -r replay.log