16 KiB
16 KiB
In [1]:
from notebook_preamble import J, V, defineIn [2]:
J('[1 [2 [3 4 25 6] 7] 8]')[1 [2 [3 4 25 6] 7] 8]
In [3]:
define('z-down == [] swap uncons swap')
define('z-up == swons swap shunt')
define('z-right == [swons] cons dip uncons swap')
define('z-left == swons [uncons swap] dip swap')In [4]:
V('[1 [2 [3 4 25 6] 7] 8] z-down'). [1 [2 [3 4 25 6] 7] 8] z-down [1 [2 [3 4 25 6] 7] 8] . z-down [1 [2 [3 4 25 6] 7] 8] . [] swap uncons swap [1 [2 [3 4 25 6] 7] 8] [] . swap uncons swap [] [1 [2 [3 4 25 6] 7] 8] . uncons swap [] 1 [[2 [3 4 25 6] 7] 8] . swap [] [[2 [3 4 25 6] 7] 8] 1 .
In [5]:
V('[] [[2 [3 4 25 6] 7] 8] 1 z-right') . [] [[2 [3 4 25 6] 7] 8] 1 z-right
[] . [[2 [3 4 25 6] 7] 8] 1 z-right
[] [[2 [3 4 25 6] 7] 8] . 1 z-right
[] [[2 [3 4 25 6] 7] 8] 1 . z-right
[] [[2 [3 4 25 6] 7] 8] 1 . [swons] cons dip uncons swap
[] [[2 [3 4 25 6] 7] 8] 1 [swons] . cons dip uncons swap
[] [[2 [3 4 25 6] 7] 8] [1 swons] . dip uncons swap
[] . 1 swons [[2 [3 4 25 6] 7] 8] uncons swap
[] 1 . swons [[2 [3 4 25 6] 7] 8] uncons swap
[] 1 . swap cons [[2 [3 4 25 6] 7] 8] uncons swap
1 [] . cons [[2 [3 4 25 6] 7] 8] uncons swap
[1] . [[2 [3 4 25 6] 7] 8] uncons swap
[1] [[2 [3 4 25 6] 7] 8] . uncons swap
[1] [2 [3 4 25 6] 7] [8] . swap
[1] [8] [2 [3 4 25 6] 7] .
In [6]:
J('[1] [8] [2 [3 4 25 6] 7] z-down')[1] [8] [] [[3 4 25 6] 7] 2
In [7]:
J('[1] [8] [] [[3 4 25 6] 7] 2 z-right')[1] [8] [2] [7] [3 4 25 6]
In [8]:
J('[1] [8] [2] [7] [3 4 25 6] z-down')[1] [8] [2] [7] [] [4 25 6] 3
In [9]:
J('[1] [8] [2] [7] [] [4 25 6] 3 z-right')[1] [8] [2] [7] [3] [25 6] 4
In [10]:
J('[1] [8] [2] [7] [3] [25 6] 4 z-right')[1] [8] [2] [7] [4 3] [6] 25
In [11]:
J('[1] [8] [2] [7] [4 3] [6] 25 sqr')[1] [8] [2] [7] [4 3] [6] 625
In [12]:
V('[1] [8] [2] [7] [4 3] [6] 625 z-up') . [1] [8] [2] [7] [4 3] [6] 625 z-up
[1] . [8] [2] [7] [4 3] [6] 625 z-up
[1] [8] . [2] [7] [4 3] [6] 625 z-up
[1] [8] [2] . [7] [4 3] [6] 625 z-up
[1] [8] [2] [7] . [4 3] [6] 625 z-up
[1] [8] [2] [7] [4 3] . [6] 625 z-up
[1] [8] [2] [7] [4 3] [6] . 625 z-up
[1] [8] [2] [7] [4 3] [6] 625 . z-up
[1] [8] [2] [7] [4 3] [6] 625 . swons swap shunt
[1] [8] [2] [7] [4 3] [6] 625 . swap cons swap shunt
[1] [8] [2] [7] [4 3] 625 [6] . cons swap shunt
[1] [8] [2] [7] [4 3] [625 6] . swap shunt
[1] [8] [2] [7] [625 6] [4 3] . shunt
[1] [8] [2] [7] [3 4 625 6] .
In [13]:
J('[1] [8] [2] [7] [3 4 625 6] z-up')[1] [8] [2 [3 4 625 6] 7]
In [14]:
J('[1] [8] [2 [3 4 625 6] 7] z-up')[1 [2 [3 4 625 6] 7] 8]
In [15]:
V('[1 [2 [3 4 25 6] 7] 8] [[[[[[sqr] dipd] infra] dip] infra] dip] infra') . [1 [2 [3 4 25 6] 7] 8] [[[[[[sqr] dipd] infra] dip] infra] dip] infra
[1 [2 [3 4 25 6] 7] 8] . [[[[[[sqr] dipd] infra] dip] infra] dip] infra
[1 [2 [3 4 25 6] 7] 8] [[[[[[sqr] dipd] infra] dip] infra] dip] . infra
8 [2 [3 4 25 6] 7] 1 . [[[[[sqr] dipd] infra] dip] infra] dip [] swaack
8 [2 [3 4 25 6] 7] 1 [[[[[sqr] dipd] infra] dip] infra] . dip [] swaack
8 [2 [3 4 25 6] 7] . [[[[sqr] dipd] infra] dip] infra 1 [] swaack
8 [2 [3 4 25 6] 7] [[[[sqr] dipd] infra] dip] . infra 1 [] swaack
7 [3 4 25 6] 2 . [[[sqr] dipd] infra] dip [8] swaack 1 [] swaack
7 [3 4 25 6] 2 [[[sqr] dipd] infra] . dip [8] swaack 1 [] swaack
7 [3 4 25 6] . [[sqr] dipd] infra 2 [8] swaack 1 [] swaack
7 [3 4 25 6] [[sqr] dipd] . infra 2 [8] swaack 1 [] swaack
6 25 4 3 . [sqr] dipd [7] swaack 2 [8] swaack 1 [] swaack
6 25 4 3 [sqr] . dipd [7] swaack 2 [8] swaack 1 [] swaack
6 25 . sqr 4 3 [7] swaack 2 [8] swaack 1 [] swaack
6 25 . dup mul 4 3 [7] swaack 2 [8] swaack 1 [] swaack
6 25 25 . mul 4 3 [7] swaack 2 [8] swaack 1 [] swaack
6 625 . 4 3 [7] swaack 2 [8] swaack 1 [] swaack
6 625 4 . 3 [7] swaack 2 [8] swaack 1 [] swaack
6 625 4 3 . [7] swaack 2 [8] swaack 1 [] swaack
6 625 4 3 [7] . swaack 2 [8] swaack 1 [] swaack
7 [3 4 625 6] . 2 [8] swaack 1 [] swaack
7 [3 4 625 6] 2 . [8] swaack 1 [] swaack
7 [3 4 625 6] 2 [8] . swaack 1 [] swaack
8 [2 [3 4 625 6] 7] . 1 [] swaack
8 [2 [3 4 625 6] 7] 1 . [] swaack
8 [2 [3 4 625 6] 7] 1 [] . swaack
[1 [2 [3 4 625 6] 7] 8] .
In [16]:
define('Z == [[] cons cons] step i')In [17]:
V('1 [2 3 4] Z') . 1 [2 3 4] Z
1 . [2 3 4] Z
1 [2 3 4] . Z
1 [2 3 4] . [[] cons cons] step i
1 [2 3 4] [[] cons cons] . step i
1 2 [[] cons cons] . i [3 4] [[] cons cons] step i
1 2 . [] cons cons [3 4] [[] cons cons] step i
1 2 [] . cons cons [3 4] [[] cons cons] step i
1 [2] . cons [3 4] [[] cons cons] step i
[1 2] . [3 4] [[] cons cons] step i
[1 2] [3 4] . [[] cons cons] step i
[1 2] [3 4] [[] cons cons] . step i
[1 2] 3 [[] cons cons] . i [4] [[] cons cons] step i
[1 2] 3 . [] cons cons [4] [[] cons cons] step i
[1 2] 3 [] . cons cons [4] [[] cons cons] step i
[1 2] [3] . cons [4] [[] cons cons] step i
[[1 2] 3] . [4] [[] cons cons] step i
[[1 2] 3] [4] . [[] cons cons] step i
[[1 2] 3] [4] [[] cons cons] . step i
[[1 2] 3] 4 [[] cons cons] . i i
[[1 2] 3] 4 . [] cons cons i
[[1 2] 3] 4 [] . cons cons i
[[1 2] 3] [4] . cons i
[[[1 2] 3] 4] . i
. [[1 2] 3] 4
[[1 2] 3] . 4
[[1 2] 3] 4 .
In [18]:
J('[1 [2 [3 4 25 6] 7] 8] [sqr] [dip dip infra dip infra dip infra] Z')[1 [2 [3 4 625 6] 7] 8]
In [19]: