Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{ parameter int ;
storage int ;
code { PUSH int 1 ;
SWAP ;
CAR ;
PAIR ;
LEFT int ;
LOOP_LEFT
{ DUP ;
CAR ;
SWAP ;
CDR ;
PUSH int 0 ;
DIG 2 ;
DUP ;
DUG 3 ;
COMPARE ;
GT ;
IF { SWAP ;
DUP ;
DUG 2 ;
SWAP ;
MUL ;
PUSH int 1 ;
DIG 2 ;
SUB ;
PAIR ;
LEFT int }
{ SWAP ; DROP ; RIGHT (pair int int) } } ;
NIL operation ;
PAIR } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment