Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [q] SX
- [
- z 0 =X # stop when stack empty
- d;g 1+ r:g # g(top) = g(top) + 1
- lLx # loop
- ] SL
- lLx
- [
- 1- d _1=X # i = i-1 -> (i == _1 exit) i
- d lt+;g ls+ ss # i -> (s = s + g(t+i)) i
- lSx
- ] SS
- [
- 0 ss 9lSx s.
- [Part 1: ]n lsps.
- ] S1
- [
- lt d 80=1 d 256=X
- d;g r7+ ;g+ lt7+:g # t -> g(t) t -> g(t+7)+g(t) -> g(t+7) = g(t+7)+g(t)
- lt d;g r9+ ;g+ lt9+:g # ditto, but with t+9
- lt 1+ st # t++
- lTx
- ] ST
- 0 st lTx
- 0 ss 9lSx
- [Part 2: ]n lsps.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement