Run-length encoding: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added comments.) |
m (→{{header|REXX}}: added wording to the REXX section header.) |
||
Line 4,139: | Line 4,139: | ||
An error message is generated if the input text is invalid. |
An error message is generated if the input text is invalid. |
||
In addition, a ''yay'' or ''nay'' message is also displayed if the decoding of the encoding was successful. |
|||
Note that this REXX version (for encoding and decoding) uses a ''replication'' count, not the ''count'' of characters, |
Note that this REXX version (for encoding and decoding) uses a ''replication'' count, not the ''count'' of characters, |
||
Line 4,149: | Line 4,151: | ||
say 'encoded=' encode /* display run─len*/ |
say 'encoded=' encode /* display run─len*/ |
||
decode= RLD(encode); say 'decoded=' decode /*decode the run─len; display decode.*/ |
decode= RLD(encode); say 'decoded=' decode /*decode the run─len; display decode.*/ |
||
if decode==input then say 'OK'; else say "¬ OK" /*display yay or nay (success/failure).*/ |
|||
exit 0 /*stick a fork in it, we're all done. */ |
exit 0 /*stick a fork in it, we're all done. */ |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |