34 lines
550 B
Plaintext
34 lines
550 B
Plaintext
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
|