Anonymous user
Run-length encoding: Difference between revisions
m
→{{header|REXX}}: added wording to the REXX section header.
m (→{{header|REXX}}: added comments.) |
m (→{{header|REXX}}: added wording to the REXX section header.) |
||
Line 4,139:
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,
Line 4,149 ⟶ 4,151:
say 'encoded=' encode /* display run─len*/
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. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
|