From: | shadowrn@*********.com (Gurth) |
---|---|
Subject: | That D8 script... |
Date: | Sat Dec 8 07:45:00 2001 |
bug in it that could cause the rolls to be off. Here's a revised version:
-----script starts here-----
#! /usr/bin/env python
import random, sys
random.seed()
n = int(sys.argv[1])
c = 0
rolls = []
while c < n:
c = c + 1
r = int(random.random() * 8)
r2 = 1
while r % 7 == 0 and r != 0 and r2 != 0:
r2 = int(random.random() * 8)
r = r + r2
rolls.append(r)
rolls.sort()
print rolls
--
Gurth@******.nl - http://www.xs4all.nl/~gurth/index.html
"I know you're expecting me to take that as good news," Randy says.
-> NAGEE Editor * ShadowRN GridSec * Triangle Virtuoso <-
-> The Plastic Warriors Page: http://plastic.dumpshock.com <-
GC3.12: GAT/! d-(dpu) s:- !a>? C+@ UL P L++ E W-(++) N o? K w+(--) O V?
PS+ PE(-)(+) Y PGP- t@ 5++ X(+) R+++(-)>$ tv+ b++@ DI- D+ G+ e h! !r y?
Incubated into the First Church of the Sqooshy Ball, 21-05-1998