Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
33
Task/Run-length-encoding/EasyLang/run-length-encoding.easy
Normal file
33
Task/Run-length-encoding/EasyLang/run-length-encoding.easy
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
proc enc in$ . out$ .
|
||||
out$ = ""
|
||||
for c$ in strchars in$
|
||||
if c$ = c0$
|
||||
cnt += 1
|
||||
else
|
||||
if cnt > 0
|
||||
out$ &= cnt & c0$ & " "
|
||||
.
|
||||
c0$ = c$
|
||||
cnt = 1
|
||||
.
|
||||
.
|
||||
out$ &= cnt & c0$
|
||||
.
|
||||
proc dec in$ . out$ .
|
||||
out$ = ""
|
||||
for h$ in strsplit in$ " "
|
||||
c$ = substr h$ len h$ 1
|
||||
for i to number h$
|
||||
out$ &= c$
|
||||
.
|
||||
.
|
||||
.
|
||||
s$ = input
|
||||
print s$
|
||||
call enc s$ s$
|
||||
print s$
|
||||
call dec s$ s$
|
||||
print s$
|
||||
#
|
||||
input_data
|
||||
WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
|
||||
Loading…
Add table
Add a link
Reference in a new issue