Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [q] SX
- [1+] S1 # inc
- [_1*] SN # negate
- [ d 0>N ] S| # abs
- [ d l|x d 0=1 / ] SS # sign
- [ lc 1+ sc ] SC
- [
- lp dd;g 1+ d 2=C r:g # p -> (g(p)+1 = 2, count) g(p)+1 p p -> (g(p) = g(p)+1) p
- le=X # p -> (p = e, exit)
- lp ls+ sp # p -> (p = p+s)
- lIx
- ] SI
- [
- z 0 =X # stop when stack empty
- sy sx sb sa # store top four in (x,y) and (a,b)
- ly 1000* lx+ sp # calculate pos
- lb 1000* la+ se # calculate end
- lb ly- lSx 1000* la lx- lSx+ ss # calculate step
- lIx
- [count = ]n lcps.
- lLx
- ] SL
- 0 sc # count = 0
- lLx
- [Part 2: ]n lcps.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement