June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,43 @@
.de end
..
.de array
. nr \\$1.c 0 1
. de \\$1.push end
. nr \\$1..\\\\n+[\\$1.c] \\\\$1
. end
. de \\$1.pushln end
. if \\\\n(.$>0 .\\$1.push \\\\$1
. if \\\\n(.$>1 \{ \
. shift
. \\$1.pushln \\\\$@
. \}
. end
. de \\$1.dump end
. nr i 0 1
. while \\\\n+i<=\\\\n[\\$1.c] .tm \\\\n[\\$1..\\\\ni]
. rr i
. end
. de \\$1.swap end
. if (\\\\$1<=\\\\n[\\$1.c])&(\\\\$2<=\\\\n[\\$1.c]) \{ \
. nr b \\\\n[\\$1..\\\\$1]
. nr \\$1..\\\\$1 \\\\n[\\$1..\\\\$2]
. nr \\$1..\\\\$2 \\\\nb
. rr b
. \}
. end
..
.array myArray
.myArray.pushln 14 62 483 21 12 11 0 589 212 10 5 4 95 4 2 2 12 0 0
.de sort
. nr i 0 1
. while \\n+i<=\\n[\\$1.c] \{ \
. nr j \\ni 1
. nr st \\nj
. while \\n+j<=\\n[\\$1.c] \{ \
. if \\n[\\$1..\\nj]<\\n[\\$1..\\n(st] .nr st \\nj
. \}
. if !\\n(st=\\ni .\\$1.swap \\ni \\n(st
. \}
..
.sort myArray
.myArray.dump

View file

@ -0,0 +1,19 @@
0
0
0
2
2
4
4
5
10
11
12
12
14
21
62
95
212
483
589