September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -6,17 +6,17 @@ call gnomeSort # /*invoke the well─known gnom
call show ' after sort' /*display the after array elements.*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
gen: @.=; @.1='---the seven virtues---'; @.4="Hope" ; @.7='Justice'
@.2='======================='; @.5="Charity [LOVE]"; @.8='Prudence'
@.3='Faith' ; @.6="Fortitude" ; @.9='Temperance'
do #=1 while @.#\==''; end; #=#-1; w=length(#); return /*find # items.*/
gen: @.=; @.1= '---the seven virtues---'; @.4= "Hope" ; @.7= 'Justice'
@.2= '======================='; @.5= "Charity [Love]"; @.8= 'Prudence'
@.3= 'Faith' ; @.6= "Fortitude" ; @.9= 'Temperance'
do #=1 while @.#\==''; end; #= #-1; w= length(#); return /*get #items*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
gnomeSort: procedure expose @.; parse arg n; k=2 /*N: is number items. */
do j=3 while k<=n; p=k-1 /*P: is previous item.*/
if @.p<<=@.k then do; k=j; iterate; end /*order is OK so far. */
_=@.p; @.p=@.k; @.k=_ /*swap two @ entries. */
k=k-1; if k==1 then k=j; else j=j-1 /*test for 1st index. */
gnomeSort: procedure expose @.; parse arg n; k= 2 /*N: is number items. */
do j=3 while k<=n; p= k - 1 /*P: is previous item.*/
if @.p<<=@.k then do; k= j; iterate; end /*order is OK so far. */
_= @.p; @.p= @.k; @.k= _ /*swap two @ entries. */
k= k-1; if k==1 then k=j; else j= j-1 /*test for 1st index. */
end /*j*/
return
/*──────────────────────────────────────────────────────────────────────────────────────*/
show: do j=1 for #; say ' element' right(j,w) arg(1)":" @.j; end; return
show: do j=1 for #; say ' element' right(j, w) arg(1)":" @.j; end; return