Run-length encoding: Difference between revisions
Content added Content deleted
Line 2,205: | Line 2,205: | ||
<syntaxhighlight lang="easylang"> |
<syntaxhighlight lang="easylang"> |
||
proc |
proc encode in$ . out$ . |
||
out$ = "" |
out$ = "" |
||
for c$ in strchars in$ |
for c$ in strchars in$ |
||
Line 2,220: | Line 2,220: | ||
out$ &= cnt & c0$ |
out$ &= cnt & c0$ |
||
. |
. |
||
proc |
proc decode in$ . out$ . |
||
out$ = "" |
out$ = "" |
||
for h$ in strsplit in$ " " |
for h$ in strsplit in$ " " |
||
Line 2,229: | Line 2,229: | ||
. |
. |
||
. |
. |
||
call |
call encode input r$ |
||
print r$ |
print r$ |
||
call |
call decode input r$ |
||
print r$ |
print r$ |
||
# |
# |
||
Line 2,239: | Line 2,239: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Elena}}== |
=={{header|Elena}}== |