ligo/test/contracts/build_list.tz
2017-11-03 15:51:11 +01:00

8 lines
285 B
Plaintext

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