File: testsuite_random_include.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (29 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# testsuite_random_include section for BASIC256

# Modification History
# date		programmer	description
# 20140813	j.m.reneau	split from testsuite

currentsuite = "random"

clg
fastgraphics
min = rand
max = rand
tot = 0
k = 100000
for t = 1 to k
   n = rand
   if n < min then min = n
   if n > max then max = n
   tot = tot + n
   plot n*300,t%300
   if t%1000=0 then
      refresh
      color rgb(rand*256, rand*256, rand*256)
   end if
next t
tot = tot / k
call n("rand min "+min+">= 0..", min >=0, true)
call n("rand max "+max+"< 1", max < 1, true)
call n("rand avg "+tot+" ~ .5", tot>=.49 and tot<=.51, true)