Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/dc -f-
- [q] SX
- [
- rdd # 0 mag -> mag mag 0 (zero is rel-cmd, leave on top)
- lx+sx la*ly+sy r # -> (x += mag) mag 0 -> (y += a * mag) 0
- ] SF
- [
- z 0 =X # stop when stack empty
- r # mag cmd -> cmd mag
- 102r- # -> rel-cmd mag (cmd now relative to ASCII 'f')
- d 0=F # (rel-cmd = 0) rel-cmd mag
- 7*13% # sign mag (this works for -15, 0, and 2 which is all we need)
- * la+ sa # a += sign * mag
- lLx # loop
- ] SL
- 0dd sx sy sa # init x, y, a
- lLx # start loop
- [Part 1: ]n lx la* p
- [Part 2: ]n lx ly* p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement