Subversion Repositories Local Hare Voting

Rev

Rev 51 | Rev 53 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51 Rev 52
Line 28... Line 28...
28
 
28
 
29
fdOut = None
29
fdOut = None
30
fTrace = 1
30
fTrace = 1
31
randcalls = 0
31
randcalls = 0
32
 
32
 
33
class Universe:
-
 
34
    p = 1               # probability of this universe existing
-
 
35
    winners = None
-
 
36
    losers = None
-
 
37
    tally = None
-
 
38
 
-
 
39
    def getP(self):
-
 
40
        print "instance p =", self.p
-
 
41
        print "class p =", Universe.p
-
 
42
 
-
 
43
print Universe.p
-
 
44
x = Universe()
-
 
45
print x.p
-
 
46
x.p = 5
-
 
47
print Universe.p
-
 
48
print x.p
-
 
49
x.getP()
-
 
50
 
-
 
51
def trace(s):
33
def trace(s):
52
    global fTrace, fdOut
34
    global fTrace, fdOut
53
    if fTrace: print >>fdOut, s
35
    if fTrace: print >>fdOut, s
54
    return
36
    return
55
 
37