new tasks

This commit is contained in:
Ingy döt Net 2013-04-09 00:46:50 -07:00
parent 2a4d27cea0
commit 80737d5a6a
1194 changed files with 15353 additions and 1 deletions

View file

@ -0,0 +1,13 @@
/*REXX program demonstrates array usage with mimicry. */
a. = 'not found' /*value for all a.xxx (so far). */
do j=1 to 100 /*start at 1, define 100 elements*/
a.j = -j * 100 /*define element as -J thousand.*/
end /*j*/ /*the above defines 100 elements.*/
say 'element 50 is:' a(50)
say 'element 3000 is:' a(3000)
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────A subroutine────────────────────────*/
a: _a_ = arg(1); return a._a_

View file

@ -0,0 +1,9 @@
/*REXX program demonstrates array usage with assigned default.*/
a.=00 /*value for all a.xxx (so far). */
do j=1 to 100 /*start at 1, define 100 array elements.*/
a.j=-j*100 /*define element as negative J thousand.*/
end /*the above defines 100 elements. */
say 'element 50 is:' a.50
say 'element 3000 is:' a.3000

View file

@ -0,0 +1,10 @@
/*REXX program demonstrates array usage. */
array.='out of range' /*for now, define ALL elements to this. */
do j=-3000 to 3000 /*start at -3k, going up to +3k. */
array.j=j**2 /*define element as it's square. */
end /*the above defines 6,001 elements. */
g=-7
say g "squared is:" array.g
say 7000 "squared is:" array.7000

View file

@ -0,0 +1,16 @@
/*REXX program demonstrates disjointed array usage. */
yr.='year not supported' /*value for all yr.xxx (so far). */
do k=600 to 1100 /*Define a bunch of years prior to 1800.*/
yr.k=k "AD"
end
do j=1800 to 2100 /*start at 1800, define a bunch of years*/
yr.j=j 'AD' /*define Jth element as the year itself.*/
end /*the above defines 301 elements. */
year=1946
say 'DOB' year "is:" yr.year
year=1744
say 'DOB' year "is:" yr.year

View file

@ -0,0 +1,29 @@
/*REXX program demonstrates array usage: sparse and disjointed. */
yyy = -55
a.yyy = 1e9 /*REXX must use this mechanism for neg idx.*/
a.1=1000
a.2=2000.0001
a.7 = 7000
a.2012 = 'out here in left field.'
a.cat='civet, but not a true cat --- belonging to the family Viverridae'
a.civet="A.K.A.: toddycats"
/*------------------------------------------------------------------------
Array elements need not be continous (nor even defined). They can hold
any nanner of numbers, or strings (which can include any characters,
including null or '00'x characters).
Array elements need not be numeric, as the above code demonstrates.
Indeed, the element "name" can be ANYTHING, even non-displayable
characters. To illustrate:
--------------------------------------------------------------------------*/
stuff=')g.u.t.s( or ½ of an intestine!'
a.stuff=44
/*--------------------------------------------------------------
where the element name has special characters, blanks, and
the glyph of one-half, as well as the symbol used in REXX to
indentify stemmed arrays (the period).
----------------------------------------------------------------*/

View file

@ -0,0 +1,9 @@
/*REXX program demonstrates array usage. */
a.='not found' /*value for all a.xxx (so far). */
do j=1 to 100 /*start at 1, define 100 array elements.*/
a.j=-j*100 /*define element as negative J thousand.*/
end /*the above defines 100 elements. */
say 'element 50 is:' a.50
say 'element 3000 is:' a.3000