File: subroutine_squares.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 (19 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# subroutine test - Draw random squares
# 2012-10-04 j.m.reneau

clg
for n= 1 to 10
   call randomsquare()

next n
end

subroutine randomsquare()
   color rgb(rnd(256),rnd(256),rnd(256))
   hw = rnd(100)
   rect rnd(300-hw),rnd(300-hw),hw,hw
end subroutine

function rnd(n)
   rnd = int(rand*n)
end function