September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,17 +1,13 @@
/*REXX pgm shows ranges of numbers with ordinal (st/nd/rd/th) suffixes.*/
call tell 0, 25 /*show the 1st range of numbers. */
call tell 250, 265 /* " " 2nd " " " */
call tell 1000, 1025 /* " " 3rd " " " */
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────TELL subroutine─────────────────────*/
tell: procedure; parse arg L,H; $= /*get Low & High #s, nullify list*/
do j=L to H /*process the range, low───►high.*/
$=$ j || th(j) /*append the Nth number to list*/
end /*j*/ /* [↑] $ has a leading blank. */
say 'numbers from ' L " to " H ' (inclusive):' /*display the title.*/
say strip($) /*display the list. */
say /*display blank line*/
return /*return to invoker.*/
/*──────────────────────────────────TH subroutine───────────────────────*/
th: procedure; parse arg x; x=abs(x) /*just use ABS value*/
return word('th st nd rd', 1 + x//10 * (x//100%10 \== 1) * (x//10 < 4) )
/*REXX program shows ranges of numbers with ordinal (st/nd/rd/th) suffixes attached.*/
call tell 0, 25 /*display the 1st range of numbers. */
call tell 250, 265 /* " " 2nd " " " */
call tell 1000, 1025 /* " " 3rd " " " */
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
tell: procedure; parse arg L,H,,$ /*get the Low and High #s, nullify list*/
do j=L to H; $=$ th(j); end /*process the range, from low ───► high*/
say 'numbers from ' L " to " H ' (inclusive):' /*display the title. */
say strip($); say; say /*display line; 2 sep*/
return /*return to invoker. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
th: parse arg z; x=abs(z); return z||word('th st nd rd',1+x//10*(x//100%10\==1)*(x//10<4))