interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / run-length-encoding / run-length-encoding.om

15 lines · 692 bytes Raw Blame History
1note Exercism-style exercise "run-length-encoding": https://exercism.org/tracks/python/exercises/run-length-encoding
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note encode writes the run-length encoding of s into o: each run of 2 or more equal bytes becomes its
4note decimal count followed by the byte, a single byte stays as it is. decode reverses it. Both
5note return the number of bytes written.
6note Check it with: sh exercise.sh exercises/run-length-encoding
7om2
8fn encode s view uchar * o edit uchar * to ulong
9note replace this line with your solution
10trap 13
11end
12fn decode s view uchar * o edit uchar * to ulong
13note replace this line with your solution
14trap 13
15end