From: Eric S. Raymond Date: Fri, 20 Oct 2006 20:51:15 +0000 (+0000) Subject: Getv rid of some scaffolding. X-Git-Tag: 2.0~55 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0e85b75c56382105184723edbab786686b18b8d1;p=super-star-trek.git Getv rid of some scaffolding. --- diff --git a/src/sst.py b/src/sst.py index ebcf75f..09e9ef6 100644 --- a/src/sst.py +++ b/src/sst.py @@ -373,22 +373,17 @@ FHOLE = 20 FCREW = 21 def withprob(p): - v = random.random() - #logfp.write("# withprob(%s) -> %f (%s) at %s\n" % (p, v, v %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:])) - return v + return random.randrange(*args) def randreal(*args): v = random.random() if len(args) == 1: - v *= args[0] # returns from [0, args[0]) + v *= args[0] # from [0, args[0]) elif len(args) == 2: - v = args[0] + v*(args[1]-args[0]) # returns from [args[0], args[1]) - #logfp.write("# randreal%s -> %s at %s\n" % (args, v, traceback.extract_stack()[-2][1:])) + v = args[0] + v*(args[1]-args[0]) # from [args[0], args[1]) return v # Code from ai.c begins here