''
'' cosc611HW4p4.sim
'' simc cosc611HW4p4.sim
''
PREAMBLE
define i as integer variable
define uniform as real 1-dim array
define stduniform as real 1-dim array
define triangular as real 1-dim array
define total1 as real variable
END
MAIN
'' file output
open 3 for output, name="data.txt"
use 3 for output
reserve uniform(*) as 10
reserve stduniform(*) as 10
reserve triangular(*) as 9
'' Uniform
for i=1 to 10
do
let uniform(i)=uniform.f(0, 20, dim.f(seed.v))
loop
print 1 line as follows
Uniform number distribution:
List uniform
'' Standard Uniform
for i=1 to 10
do
let stduniform(i)=uniform.f(0, 1, dim.f(seed.v))
loop
print 1 line as follows
Standard Uniform number distribution:
List stduniform
'' Triangular
for i=1 to 9
do
let triangular(i)=uniform(i) - uniform(i+1)
loop
print 1 line as follows
Triangular number distribution:
List triangular
'' end main
end