Order two numerical lists: Difference between revisions

m
→‎{{header|REXX}}: changed logic, added comments.
m (→‎{{header|REXX}}: added/changed comments and whitespace, used a template for the output section.)
m (→‎{{header|REXX}}: changed logic, added comments.)
Line 1,393:
/* [↓] compare a list to previous list*/
do j=2 while @.j\==''; p= j - 1 /*P: points to previous value in list.*/
answer=if FNorder(@.p, @.j)=='true' then is= " < " /*obtainuse a more thefamiliar answerglyph.*/
else is= " " /*else is= " " " /* " " " " " */
 
if answer=='true' then is= " < " /*use a more familiar glyph for display*/
else is= " ≥ " /* " " " " " " " */
say
say right('['@.p"]", 40) is '['@.j"]"
Line 1,405 ⟶ 1,403:
wx= words(x); wy= words(y)
do k=1 for min(wx, wy)
a= word(x, k) /*get a value from X. */
b= word(y, k) /* " " " " Y. */
if a<b then return 'true'
else if a>b then return 'false'
end /*k*/
if wx<wy then return 'true' /*handle case of equal (so far). */
return 'false' /* " " " " " " */</lang>
{{out|output|:}}
<pre>