Find words with alternating vowels and consonants: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) m Remove some stray editing debris |
m →{{header|ALGOL 68}}: Simplify padding |
||
Line 39: | Line 39: | ||
# blank pads s on the left to width characters # |
# blank pads s on the left to width characters # |
||
PRIO PAD = 1; |
PRIO PAD = 1; |
||
OP PAD = ( INT width, STRING s )STRING: |
OP PAD = ( INT width, STRING s )STRING: IF LENGTH s >= width THEN s ELSE ( " " * ( width - LENGTH s ) ) + s FI; |
||
IF LENGTH s >= width THEN s |
|||
ELSE |
|||
STRING result := s; |
|||
WHILE LENGTH result < width DO " " +=: result OD; |
|||
result |
|||
FI; # PAD # |
|||
INT alternating count := 0; |
INT alternating count := 0; |
||
WHILE STRING word; |
WHILE STRING word; |