ligo/test/contracts/build_list.tz

8 lines
243 B
Plaintext

parameter nat;
return (list nat);
storage unit;
code {CAR; NIL nat; SWAP; DUP; PUSH nat 0; CMPNEQ;
LOOP {DUP; DIP {SWAP}; CONS; SWAP; PUSH nat 1; SWAP; SUB;
DUP; DIP{ABS} ; PUSH int 0; CMPNEQ};
CONS; UNIT; SWAP; PAIR};