Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,19 +1,23 @@
|
|||
/*REXX pgm finds if list1<list2 (both contain nums), returns true|false.*/
|
||||
@.=
|
||||
@.1=1 2 1 5 2
|
||||
@.2=1 2 1 5 2 2
|
||||
@.3=1 2 3 4 5
|
||||
@.4=1 2 3 4 5
|
||||
do i=2 while @.i\==''; m=i-1
|
||||
what=' 'word("< ≥", 1+(FNorder(@.m, @.i)=='false'))" "
|
||||
say right('['@.m"]", 35) what '['@.i"]"; say
|
||||
end /*i*/
|
||||
/*REXX pgm determines if a list < previous list, & returns true | false*/
|
||||
@. =
|
||||
@.1 = 1 2 1 5 2
|
||||
@.2 = 1 2 1 5 2 2
|
||||
@.3 = 1 2 3 4 5
|
||||
@.4 = 1 2 3 4 5 /* [↓] compare list to previous.*/
|
||||
do j=2 while @.j\==''; p=j-1 /*P is the previous.*/
|
||||
answer=FNorder(@.p, @.j) /*obtain the answer.*/
|
||||
if answer=='true' then is= ' < ' /*convert from true */
|
||||
else is= ' ≥ ' /*convert from false*/
|
||||
say right('['@.p"]", 40) is '['@.j"]"; say
|
||||
end /*i*/ /* [↑] display (+ a blank line)*/
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*──────────────────────────────────FNORDER subroutine──────────────────*/
|
||||
FNorder: procedure; parse arg x,y; wx=words(x); wy=words(y)
|
||||
FNorder: procedure; parse arg x,y; wx=words(x); wy=words(y)
|
||||
|
||||
do j=1 for min(wx,wy)
|
||||
if word(x,j)<word(y,j) then return 'true'
|
||||
end /*j*/
|
||||
do k=1 for min(wx,wy)
|
||||
a=word(x,k); b=word(y,k)
|
||||
if a<b then return 'true'
|
||||
else if a>b then return 'false'
|
||||
end /*k*/
|
||||
if wx<wy then return 'true'
|
||||
return 'false'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue