Filter: Difference between revisions

m
→‎using two arrays: aeded a programming note. -- ~~~~
m (→‎{{header|REXX}}: re-worked all examples to use the RANDOM function to make the program much simplier. -- ~~~~)
m (→‎using two arrays: aeded a programming note. -- ~~~~)
Line 1,581:
end /*k*/
/*stick a fork in it, we're done.*/</lang>
Programming note: &nbsp; the REXX statement
<lang rexx> if old.j//2 \== 0 then iterate</lang>
could've been replaced with
<lang rexx> if old.j//2 then iterate</lang>
but that would've assumed the numbers are integers &nbsp; (no matter what form they're expressed in).
<br><br>
'''output''' &nbsp; when the following is used for input: &nbsp; <tt> , 1234567 </tt>
<br>The '''1234567''' is the '''random''' BIF seed so that the random numbers can be repeated.
Line 1,608 ⟶ 1,614:
new.23 = 44360
</pre>
 
===using one array with a control array===
This version uses a control array, which isn't fully populated &nbsp; (in REXX terms, a sparse array.)