02
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 506 507 508 509 510 511 512 513 514 ... 65535 65536 65537 ...
03
4 3 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 ... -510 -511 -512 -513 -514 ... -65535 -65536 -65537 ...
04
=
0 = 0
1 = 1
2 = 2
3 = 3
...
10 = 10
11 = 11
...
-1 = -1
-2 = -2
...
05
inc
ap inc 0 = 1
ap inc 1 = 2
ap inc 2 = 3
ap inc 3 = 4
...
ap inc 300 = 301
ap inc 301 = 302
...
ap inc -1 = 0
ap inc -2 = -1
ap inc -3 = -2
...
06
dec
ap dec 1 = 0
ap dec 2 = 1
ap dec 3 = 2
ap dec 4 = 3
...
ap dec 1024 = 1023
...
ap dec 0 = -1
ap dec -1 = -2
ap dec -2 = -3
...
07
add
ap ap add 1 2 = 3
ap ap add 2 1 = 3
ap ap add 0 1 = 1
ap ap add 2 3 = 5
ap ap add 3 5 = 8
...
08
x0 x1 x2 x3 x4 ...
ap ap add 0 x0 = x0
ap ap add 0 x1 = x1
ap ap add 0 x2 = x2
...
ap ap add x0 0 = x0
ap ap add x1 0 = x1
ap ap add x2 0 = x2
...
ap ap add x0 x1 = ap ap add x1 x0
...
09
mul
ap ap mul 4 2 = 8
ap ap mul 3 4 = 12
ap ap mul 3 -2 = -6
ap ap mul x0 x1 = ap ap mul x1 x0
ap ap mul x0 0 = 0
ap ap mul x0 1 = x0
...
10
div
ap ap div 4 2 = 2
ap ap div 4 3 = 1
ap ap div 4 4 = 1
ap ap div 4 5 = 0
ap ap div 5 2 = 2
ap ap div 6 -2 = -3
ap ap div 5 -3 = -1
ap ap div -5 3 = -1
ap ap div -5 -3 = 1
ap ap div x0 1 = x0
...
11
eq
ap ap eq x0 x0 = t
ap ap eq 0 -2 = f
ap ap eq 0 -1 = f
ap ap eq 0 0 = t
ap ap eq 0 1 = f
ap ap eq 0 2 = f
...
ap ap eq 1 -1 = f
ap ap eq 1 0 = f
ap ap eq 1 1 = t
ap ap eq 1 2 = f
ap ap eq 1 3 = f
...
ap ap eq 2 0 = f
ap ap eq 2 1 = f
ap ap eq 2 2 = t
ap ap eq 2 3 = f
ap ap eq 2 4 = f
...
ap ap eq 19 20 = f
ap ap eq 20 20 = t
ap ap eq 21 20 = f
...
ap ap eq -19 -20 = f
ap ap eq -20 -20 = t
ap ap eq -21 -20 = f
...
12
lt
ap ap lt 0 -1 = f
ap ap lt 0 0 = f
ap ap lt 0 1 = t
ap ap lt 0 2 = t
...
ap ap lt 1 0 = f
ap ap lt 1 1 = f
ap ap lt 1 2 = t
ap ap lt 1 3 = t
...
ap ap lt 2 1 = f
ap ap lt 2 2 = f
ap ap lt 2 3 = t
ap ap lt 2 4 = t
...
ap ap lt 19 20 = t
ap ap lt 20 20 = f
ap ap lt 21 20 = f
...
ap ap lt -19 -20 = f
ap ap lt -20 -20 = f
ap ap lt -21 -20 = t
...
13
mod
ap mod 0 = [0]
ap mod 1 = [1]
ap mod -1 = [-1]
ap mod 2 = [2]
ap mod -2 = [-2]
...
ap mod 16 = [16]
ap mod -16 = [-16]
...
ap mod 255 = [255]
ap mod -255 = [-255]
ap mod 256 = [256]
ap mod -256 = [-256]
...
14
dem
ap dem ap mod x0 = x0
ap mod ap dem x0 = x0
15
send
... [0] [0] [0] [0] [0] [0] [0]
[0] [0]
spacecraft
[0]
0 0 0
[0] [0]
0 0 0
[0]
:63624 :63624 7 ? :22298023604371552426870186540012804662888448 nil human nil nil
ap send x0 = x1
human x0 spacecraft
human 0 [0] [0] 0 0 0 [0] [0] 0 0 ap mod x0 spacecraft
human x0 spacecraft
human x1 spacecraft
human ap mod x1 0 [0] [0] 0 0 0 [0] [0] 0 0 spacecraft
human x1 spacecraft
16
neg
ap neg 0 = 0
ap neg 1 = -1
ap neg -1 = 1
ap neg 2 = -2
ap neg -2 = 2
...
17
ap
ap inc ap inc 0 = 2
ap inc ap inc ap inc 0 = 3
ap inc ap dec x0 = x0
ap dec ap inc x0 = x0
ap dec ap ap add x0 1 = x0
ap ap add ap ap add 2 3 4 = 9
ap ap add 2 ap ap add 3 4 = 9
ap ap add ap ap mul 2 3 4 = 10
ap ap mul 2 ap ap add 3 4 = 14
inc = ap add 1
dec = ap add ap neg 1
...
18
s
ap ap ap s x0 x1 x2 = ap ap x0 x2 ap x1 x2
ap ap ap s add inc 1 = 3
ap ap ap s mul ap add 1 6 = 42
...
19
c
ap ap ap c x0 x1 x2 = ap ap x0 x2 x1
ap ap ap c add 1 2 = 3
...
20
b
ap ap ap b x0 x1 x2 = ap x0 ap x1 x2
ap ap ap b inc dec x0 = x0
...
21
t
ap ap t x0 x1 = x0
ap ap t 1 5 = 1
ap ap t t i = t
ap ap t t ap inc 5 = t
ap ap t ap inc 5 t = 6
...
22
f
ap ap f x0 x1 = x1
f = ap s t
23


pwr2
pwr2 = ap ap s ap ap c ap eq 0 1 ap ap b ap mul 2 ap ap b pwr2 ap add -1
ap pwr2 0 = ap ap ap s ap ap c ap eq 0 1 ap ap b ap mul 2 ap ap b pwr2 ap add -1 0
ap pwr2 0 = ap ap ap ap c ap eq 0 1 0 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 0
ap pwr2 0 = ap ap ap ap eq 0 0 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 0
ap pwr2 0 = ap ap t 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 0
ap pwr2 0 = 1
ap pwr2 1 = ap ap ap s ap ap c ap eq 0 1 ap ap b ap mul 2 ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap ap ap c ap eq 0 1 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap ap ap eq 0 1 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap f 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap ap b pwr2 ap add -1 1
ap pwr2 1 = ap ap mul 2 ap pwr2 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap ap s ap ap c ap eq 0 1 ap ap b ap mul 2 ap ap b pwr2 ap add -1 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap ap ap c ap eq 0 1 ap ap add -1 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap ap ap eq 0 ap ap add -1 1 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap ap ap eq 0 0 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 ap ap t 1 ap ap ap b ap mul 2 ap ap b pwr2 ap add -1 ap ap add -1 1
ap pwr2 1 = ap ap mul 2 1
ap pwr2 1 = 2
ap pwr2 2 = ap ap ap s ap ap c ap eq 0 1 ap ap b ap mul 2 ap ap b pwr2 ap add -1 2
...
ap pwr2 2 = 4
ap pwr2 3 = 8
ap pwr2 4 = 16
ap pwr2 5 = 32
ap pwr2 6 = 64
ap pwr2 7 = 128
ap pwr2 8 = 256
...
24
i
ap i x0 = x0
ap i 1 = 1
ap i i = i
ap i add = add
ap i ap add 1 = ap add 1
...
25
cons
ap ap ap cons x0 x1 x2 = ap ap x2 x0 x1
26
car
ap car ap ap cons x0 x1 = x0
ap car x2 = ap x2 t
27
cdr
ap cdr ap ap cons x0 x1 = x1
ap cdr x2 = ap x2 f
28
nil
ap nil x0 = t
29
isnil
ap isnil nil = t
ap isnil ap ap cons x0 x1 = f
30
( , )
( ) = nil
( x0 ) = ap ap cons x0 nil
( x0 , x1 ) = ap ap cons x0 ap ap cons x1 nil
( x0 , x1 , x2 ) = ap ap cons x0 ap ap cons x1 ap ap cons x2 nil
( x0 , x1 , x2 , x5 ) = ap ap cons x0 ap ap cons x1 ap ap cons x2 ap ap cons x5 nil
...
31
vec
vec = cons
32
draw
ap draw ( ) = #17:13:0
ap draw ( ap ap vec 1 1 ) = #17:13:40000
ap draw ( ap ap vec 1 2 ) = #17:13:800000000
ap draw ( ap ap vec 2 5 ) = #17:13:8000000000000000000000
ap draw ( ap ap vec 1 2 , ap ap vec 3 1 ) = #17:13:800100000
ap draw ( ap ap vec 5 3 , ap ap vec 6 3 , ap ap vec 4 4 , ap ap vec 6 4 , ap ap vec 4 5 ) = #17:13:20005000300000000000000
...
33
checkerboard
checkerboard = ap ap s ap ap b s ap ap c ap ap b c ap ap b ap c ap c ap ap s ap ap b s ap ap b ap b ap ap s i i lt eq ap ap s mul i nil ap ap s ap ap b s ap ap b ap b cons ap ap s ap ap b s ap ap b ap b cons ap c div ap c ap ap s ap ap b b ap ap c ap ap b b add neg ap ap b ap s mul div ap ap c ap ap b b checkerboard ap ap c add 2
ap ap checkerboard 7 0 = #17:13:1540054005500150015400540055
ap ap checkerboard 13 0 = #17:16:1555055505554155415550555055541554155505550555415541555
34
multipledraw
ap multipledraw nil = nil
ap multipledraw ap ap cons x0 x1 = ap ap cons ap draw x0 ap multipledraw x1
35
mod cons
ap mod nil =
ap mod ap ap cons nil nil = [0]
ap mod ap ap cons 0 nil = [0]
ap mod ap ap cons 1 2 = [-22]
ap mod ap ap cons 1 ap ap cons 2 nil = [-29]
ap mod ( 1 , 2 ) = [-29]
ap mod ( 1 , ( 2 , 3 ) , 4 ) = [-31]
...
36
:1678847
ap send ( 0 ) = ( 1 , :1678847 )
37
if0
ap ap ap if0 0 x0 x1 = x0
ap ap ap if0 1 x0 x1 = x1
38
interact
ap modem x0 = ap dem ap mod x0
ap ap f38 x2 x0 = ap ap ap if0 ap car x0 ( ap modem ap car ap cdr x0 , ap multipledraw ap car ap cdr ap cdr x0 ) ap ap ap interact x2 ap modem ap car ap cdr x0 ap send ap car ap cdr ap cdr x0
ap ap ap interact x2 x4 x5 = ap ap f38 x2 ap ap x2 x4 x5
39
interact
ap ap ap interact x0 nil ap ap vec 0 0 = ( x16 , ap multipledraw x64 )
ap ap ap interact x0 x16 ap ap vec x1 x2 = ( x17 , ap multipledraw x65 )
ap ap ap interact x0 x17 ap ap vec x3 x4 = ( x18 , ap multipledraw x66 )
ap ap ap interact x0 x18 ap ap vec x5 x6 = ( x19 , ap multipledraw x67 )
...
40
ap interact statelessdraw
ap ap statelessdraw nil x1 = ( 0 , nil , ( ( x1 ) ) )
statelessdraw = ap ap c ap ap b b ap ap b ap b ap cons 0 ap ap c ap ap b b cons ap ap c cons nil ap ap c ap ap b cons ap ap c cons nil nil
ap ap ap interact statelessdraw nil ap ap vec 1 0 = ( nil , ( #17:13:2 ) )
ap ap ap interact statelessdraw nil ap ap vec 2 3 = ( nil , ( #17:13:20000000000000 ) )
ap ap ap interact statelessdraw nil ap ap vec 4 1 = ( nil , ( #17:13:200000 ) )
...
41
ap interact :67108929
ap ap :67108929 x0 x1 = ( 0 , ap ap cons x1 x0 , ( ap ap cons x1 x0 ) )
:67108929 = ap ap b ap b ap ap s ap ap b ap b ap cons 0 ap ap c ap ap b b cons ap ap c cons nil ap ap c cons nil ap c cons
ap ap ap interact :67108929 nil ap ap vec 0 0 = ( ( ap ap vec 0 0 ) , ( #17:13:1 ) )
ap ap ap interact :67108929 ( ap ap vec 0 0 ) ap ap vec 2 3 = ( x2 , ( #17:13:20000000000001 ) )
ap ap ap interact :67108929 x2 ap ap vec 1 2 = ( x3 , ( #17:13:20000800000001 ) )
ap ap ap interact :67108929 x3 ap ap vec 3 2 = ( x4 , ( #17:13:20002800000001 ) )
ap ap ap interact :67108929 x4 ap ap vec 4 0 = ( x5 , ( #17:13:20002800000011 ) )
...
42
ap interact galaxy = ...