Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # stack: time regX sum
- [
- d 3R d 3R * # (regX * time) time regX sum
- 4R+ r3R # s = (s + (regX * time)), stack: time regX sum
- ] sS
- # main loop (stack: time regX sum ...)
- [
- 1+ # time++ regX sum ...
- d 40% # time%40 time regX sum ...
- 20=S # score if time%40 = 20, stack: time regX sum ...
- r4R # pull up data: data regX time sum ...
- + # (regX += data) time sum ...
- r # time regX sum ...
- z 3<L # loop until only 3 left
- ] sL
- 0 1 d lLx
- [Part 1: ]n 3Rp
- [<END>]ps.
- [<stack>]ps. f [<bottom>]ps.
Advertisement
Comments
-
- Run with:
- tac input | tr -- '-[[:alpha:]]' '_[0*]' | dc -f- dc-p1.dc
Add Comment
Please, Sign In to add comment
Advertisement