Filter: Difference between revisions

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

edits