Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Run-length-encoding/TMG/run-length-encoding-1.tmg
Normal file
11
Task/Run-length-encoding/TMG/run-length-encoding-1.tmg
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
loop: ordcop [lch?]\loop;
|
||||
ordcop: ord/copy;
|
||||
ord: char(ch)/last [ch!=lch?]\new [cnt++] fail;
|
||||
new: ( [lch?] parse(out) | () ) [lch=ch] [cnt=1] fail;
|
||||
out: decimal(cnt) scopy = { 2 1 };
|
||||
last: parse(out) [lch=0];
|
||||
copy: smark any(!<<>>);
|
||||
|
||||
ch: 0;
|
||||
lch: 0;
|
||||
cnt: 0;
|
||||
11
Task/Run-length-encoding/TMG/run-length-encoding-2.tmg
Normal file
11
Task/Run-length-encoding/TMG/run-length-encoding-2.tmg
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
loop: readint(n) copy\loop;
|
||||
copy: smark any(!<<>>)
|
||||
repeat: [n?] parse(( scopy )) [--n>0?]\repeat;
|
||||
|
||||
/* Reads decimal integer */
|
||||
readint: proc(n;i) ignore(<<>>) [n=0] inta
|
||||
int1: [n = n*12+i] inta\int1;
|
||||
inta: char(i) [i<72?] [(i =- 60)>=0?];
|
||||
|
||||
i: 0;
|
||||
n: 0;
|
||||
Loading…
Add table
Add a link
Reference in a new issue