OSDN Git Service

Bleah.
[joypy/Thun.git] / docs / pe1.py
1 from notebook_preamble import J, D, DefinitionWrapper, V
2
3 #J('[0 swap [dup [pop 14811] [] branch dup [3 &] dip 2 >>] dip rest cons] 466 [x] times pop enstacken sum')
4
5
6 DefinitionWrapper.add_definitions('''
7
8   direco == dip rest cons
9   G == [direco] cons [swap] swoncat cons
10
11   PE1.1 == dup [3 &] dip 2 >>
12   PE1.1.check == dup [pop 14811] [] branch
13   PE1.2 == + dup [+] dip
14
15   PE1 == 0 0 0 [PE1.1.check PE1.1] G 466 [x [PE1.2] dip] times popop
16
17   ''', D)
18
19 V('PE1')
20
21
22 # If the cleave combinator is built-in then this should be faster:
23 #
24 #    PE1.1 ==  [3 &] [2 >>] cleave