Run-length encoding: Difference between revisions

Content added Content deleted
m (→‎{{header|Ring}}: Remove vanity tags)
Line 1,589:
# value: "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW"</lang>
=={{header|Elena}}==
ELENA 3.34 :
<lang elena>import system'text.
import system'routines.
import extensions.
import extensions'text.
 
singleton compressor
{
Line 1,613 ⟶ 1,614:
]
].
tb writeFormatted("{0}{1}",count,current).
^ tb
]
literal decompress(literal s)
[
Line 1,634 ⟶ 1,635:
int count := a toInt.
a clear.
tb fill(current,count).
]
].
^ tb
]
}
 
programpublic =program
[
var s := "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW".
s := compressor compress(s).
console printLine(s).
s := compressor decompress(s).
console printLine(s).
].</lang>
{{out}}
<pre>