September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,12 +1,12 @@
|
|||
/*REXX program removes any duplicate elements (items) that are in a list. */
|
||||
$= '2 3 5 7 11 13 17 19 cats 222 -100.2 +11 1.1 +7 7. 7 5 5 3 2 0 4.4 2'
|
||||
/*REXX program removes any duplicate elements (items) that are in a list (using a hash).*/
|
||||
$= '2 3 5 7 11 13 17 19 cats 222 -100.2 +11 1.1 +7 7. 7 5 5 3 2 0 4.4 2' /*item list.*/
|
||||
say 'original list:' $
|
||||
say right(words($),17,'─') 'words in the original list.'; say
|
||||
z=; @.= /*initialize the NEW list and index list*/
|
||||
do j=1 for words($); y=word($,j) /*process the words (items) in the list.*/
|
||||
if @.y=='' then z=z y; @.y=. /*Not duplicated? Add to Z list, @ array*/
|
||||
end /*j*/
|
||||
|
||||
say 'modified list:' space(z)
|
||||
say right(words(z),17,'─') 'words in the modified list.'
|
||||
/*stick a fork in it, we're all done. */
|
||||
say right( words($), 17, '─') 'words in the original list.'
|
||||
z=; @.= /*initialize the NEW list & index list.*/
|
||||
do j=1 for words($); y=word($,j) /*process the words (items) in the list*/
|
||||
if @.y=='' then z=z y; @.y=. /*Not duplicated? Add to Z list,@ array*/
|
||||
end /*j*/
|
||||
say
|
||||
say 'modified list:' space(z)
|
||||
say right( words(z), 17, '─') 'words in the modified list.'
|
||||
/*stick a fork in it, we're all done. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue