Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
12
Task/Run-length-encoding/Oforth/run-length-encoding.oforth
Normal file
12
Task/Run-length-encoding/Oforth/run-length-encoding.oforth
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
: encode(s)
|
||||
StringBuffer new
|
||||
s group apply(#[ tuck size asString << swap first <<c ]) ;
|
||||
|
||||
: decode(s)
|
||||
| c i |
|
||||
StringBuffer new
|
||||
0 s forEach: c [
|
||||
c isDigit ifTrue: [ 10 * c asDigit + continue ]
|
||||
loop: i [ c <<c ] 0
|
||||
]
|
||||
drop ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue