File: function_randint.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 (12 lines) | stat: -rw-r--r-- 219 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
# function test - calculate random integers
# 2012-10-04 j.m.reneau

for t = 1 to 100
   print rnd(6)+" ";
next t
end

# generate random integers from 1 to i inclusive
function rnd(i)
   rnd = int(rand*i)+1
end function