From 0e85b75c56382105184723edbab786686b18b8d1 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 20 Oct 2006 20:51:15 +0000 Subject: [PATCH] Getv rid of some scaffolding. --- src/sst.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 -- 2.31.1