Filter: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) m (→{{header|REXX}}: final correction (sigh)) |
Walterpachl (talk | contribs) m (→{{header|REXX}}: last try :-() |
||
Line 3,314: | Line 3,314: | ||
Do k=1 For m /* display all the NEW numbers. */ |
Do k=1 For m /* display all the NEW numbers. */ |
||
Say right('new.'k,20) '=' right(new.k,9) |
Say right('new.'k,20) '=' right(new.k,9) |
||
End |
End </syntaxhighlight> |
||
{{out|output|text= when using the input of: <tt> , 12345 </tt>}} |
{{out|output|text= when using the input of: <tt> , 12345 </tt>}} |
||
The ''' |
The '''12345''' is the '''random''' BIF ''seed'' so that the random numbers can be repeated when re-running the REXX program. |
||
<pre> |
<pre> |
||
new.1 = 17520 |
new.1 = 17520 |
||
Line 3,344: | Line 3,344: | ||
===Using a control array=== |
===Using a control array=== |
||
This version uses a control array (even.*) |
This version uses a control array (even.*) |
||
<syntaxhighlight lang="rexx" |
<syntaxhighlight lang="rexx"> |
||
/*REXX program uses a control array to tell which elements ars even. */ |
/*REXX program uses a control array to tell which elements ars even. */ |
||
Parse Arg n seed . /* obtain optional arguments from CL*/ |
Parse Arg n seed . /* obtain optional arguments from CL*/ |
||
Line 3,361: | Line 3,361: | ||
If even.k Then /* that are even */ |
If even.k Then /* that are even */ |
||
Say right('x.'k,20) '=' right(x.k,9) |
Say right('x.'k,20) '=' right(x.k,9) |
||
End |
End</syntaxhighlight> |
||
{{out|output|text= when using the input of: <tt> 20 12345 </tt>}} |
{{out|output|text= when using the input of: <tt> 20 12345 </tt>}} |
||
<pre> |
<pre> |