Find words with alternating vowels and consonants: Difference between revisions
Content added Content deleted
(Add Seed7) |
m (→{{header|REXX}}: added whitespace, optimized first DO loop.) |
||
Line 2,144: | Line 2,144: | ||
do #=1 while lines(iFID)\==0 /*read each word in the file (word=X).*/ |
do #=1 while lines(iFID)\==0 /*read each word in the file (word=X).*/ |
||
x= strip( linein( iFID) ) /*pick off a word from the input line. */ |
x= strip( linein( iFID) ) /*pick off a word from the input line. */ |
||
$.#= x |
$.#= x /*save: original case and the semaphore*/ |
||
end /*#*/ /* [↑] semaphore name is uppercased. */ |
end /*#*/ /* [↑] semaphore name is uppercased. */ |
||
#= # - 1 /*adjust the record count (DO loop). */ |
#= # - 1 /*adjust the record count (DO loop). */ |
||
Line 2,176: | Line 2,176: | ||
finds= finds + 1 /*bump the count of "odd words" found. */ |
finds= finds + 1 /*bump the count of "odd words" found. */ |
||
w= max(w, L) /*obtain the maximum length word found.*/ |
w= max(w, L) /*obtain the maximum length word found.*/ |
||
@@@= @@@ $.j |
@@@= @@@ $.j /*add a word to the list of words found*/ |
||
end /*j*/ |
end /*j*/ |
||
/*stick a fork in it, we're all done. */ |
/*stick a fork in it, we're all done. */ |
||
Line 2,183: | Line 2,183: | ||
do out=1 for finds; z= word(@@@, out) /*build a list that will be displayed. */ |
do out=1 for finds; z= word(@@@, out) /*build a list that will be displayed. */ |
||
if length(_ right(z, w))>130 then do; say substr(_, 2); _=; end /*show a line.*/ |
if length(_ right(z, w))>130 then do; say substr(_, 2); _=; end /*show a line.*/ |
||
_= _ right(z, w) |
_= _ right(z, w) /*append (aligned word) to output line.*/ |
||
end /*out*/ |
end /*out*/ |
||
/*stick a fork in it, we're all done. */ |
/*stick a fork in it, we're all done. */ |