projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
15abf5a
)
Replay works now, at least in plain-tty mode
author
Eric S. Raymond
<esr@thyrsus.com>
Fri, 6 Oct 2006 10:54:05 +0000
(10:54 +0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Fri, 6 Oct 2006 10:54:05 +0000
(10:54 +0000)
src/sst.py
patch
|
blob
|
history
diff --git
a/src/sst.py
b/src/sst.py
index aa025c8814d12d0dbbab311df96888e2ee963513..eb440297d091e5b190d6dfa8d598b9c26c716c3f 100644
(file)
--- a/
src/sst.py
+++ b/
src/sst.py
@@
-575,12
+575,12
@@
import traceback
def withprob(p):
v = random.random()
def withprob(p):
v = random.random()
- logfp.write("# withprob(%s) -> %f (%s) at %s\n" % (p, v, v<p, traceback.extract_stack()[-2][1:]))
+
#
logfp.write("# withprob(%s) -> %f (%s) at %s\n" % (p, v, v<p, traceback.extract_stack()[-2][1:]))
return v < p
def randrange(*args):
v = random.randrange(*args)
return v < p
def randrange(*args):
v = random.randrange(*args)
- logfp.write("# randrange%s -> %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:]))
+
#
logfp.write("# randrange%s -> %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:]))
return v
def randreal(*args):
return v
def randreal(*args):
@@
-589,7
+589,7
@@
def randreal(*args):
v *= args[0] # returns from [0, a1)
elif len(args) == 2:
v = args[0] + v*args[1] # returns from [a1, a2)
v *= args[0] # returns from [0, a1)
elif len(args) == 2:
v = args[0] + v*args[1] # returns from [a1, a2)
- logfp.write("# randreal%s -> %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:]))
+
#
logfp.write("# randreal%s -> %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:]))
return v
# Code from ai.c begins here
return v
# Code from ai.c begins here
@@
-6842,7
+6842,7
@@
if __name__ == '__main__':
# game.options |= OPTION_CURSES | OPTION_SHOWME
# else:
game.options |= OPTION_TTY
# game.options |= OPTION_CURSES | OPTION_SHOWME
# else:
game.options |= OPTION_TTY
- seed =
time.time(
)
+ seed =
int(time.time()
)
(options, arguments) = getopt.getopt(sys.argv[1:], "r:tx")
for (switch, val) in options:
if switch == '-r':
(options, arguments) = getopt.getopt(sys.argv[1:], "r:tx")
for (switch, val) in options:
if switch == '-r':