Run-length encoding: Difference between revisions

Content added Content deleted
No edit summary
Line 2,873: Line 2,873:
def long m, many=1
def long m, many=1
while r$<>"" and many>0 {
while r$<>"" and many>0 {
many=val(r$, "INT", m)
many=val(r$, "INT", &m)
repl$+=string$(mid$(r$, m, 1), many)
repl$+=string$(mid$(r$, m, 1), many)
r$=mid$(r$,m+1)
r$=mid$(r$,m+1)
Line 2,893: Line 2,893:
Checked: True
Checked: True
</pre >
</pre >

=={{header|Mathematica}}==
=={{header|Mathematica}}==
Custom functions using Map, Apply, pure functions, replacing using pattern matching, delayed rules and other functions:
Custom functions using Map, Apply, pure functions, replacing using pattern matching, delayed rules and other functions: