--- /dev/null
+#!/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
the LRSCAN command is no longer needed. (Controlled by OPTION_AUTOSCAN
and turned off if game type is "plain" or "almy".)
"""
-import os,sys,math,curses,time,atexit,readline,cPickle,random,getopt,copy
+import os, sys, math, curses, time, readline, cPickle, random, copy
SSTDOC = "/usr/share/doc/sst/sst.doc"
DOC_NAME = "sst.doc"
atover(True)
if __name__ == '__main__':
+ import getopt, socket
try:
global line, thing, game, idebug
game = None
if logfp:
logfp.write("# seed %s\n" % seed)
logfp.write("# options %s\n" % " ".join(arguments))
+ logfp.write("# recorded by %s@%s on %s\n" % \
+ (os.getenv("LOGNAME"),socket.gethostname(),time.ctime()))
random.seed(seed)
scanner = sstscanner()
map(scanner.append, arguments)