Anonymous user
Subtractive generator: Difference between revisions
m
→{{header|REXX}}: order subroutines, changed whitespace, changed a comment, separated some statements.
(Added uBasic/4tH example) |
m (→{{header|REXX}}: order subroutines, changed whitespace, changed a comment, separated some statements.) |
||
Line 1,167:
This REXX program is essentially a copy of the PL/I version.
<lang rexx>/*REXX pgm uses a subtractive generator, creates a seq of random numbers*/
numeric digits 20; billion
cI
do i=2 to cI-1
s.i=mod(s(i-2)-s(i-1), billion)
end /*i*/
do j=0 to cI-1
r.j
end /*j*/
m=219
r.x
end /*m*/
t=235
r.y
say right(r.y, 40)
end /*n*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────one─liner subroutines───────────────*/
'''output''' when using the default input:
<pre>
467478574
512932792
|