File: random_one.kbs

package info (click to toggle)
basic256 0.9.6.69a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,304 kB
  • sloc: cpp: 7,778; yacc: 926; lex: 575; sh: 21; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ransom_one.kbs - test random for extremes (1.00) is very bad
# 2008/09/07 jmr
badkount = 0
kount9 = 0
kount0 = 0
for t = 1 to 1000000
   a = rand
   if a = 1 then print t + " " + a : badkount = badkount + 1
   if int(a*1000000) = 999999 then print t + " " + a : kount9 = kount9 + 1
   if int(a*1000000) = 0 then print t + " " + a : kount0 = kount0 + 1
next t
print "badkount=" + badkount
print "kount9=" + kount9
print "kount0=" + kount0
end