Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Command: tr ',' ' ' <input | dc -fdc-p1.dc
- [sm0] sS # store top in S, replace with 0
- 1 ? # y x i=0
- [
- 3R1+ # i++ y x
- d3R r:y # y(i) = y
- d3R r:x # x(i) = x
- ? z1<L
- ] dsLx
- # stack: i=num
- d;x r d;y
- 1:y r 1:x # add last to slot 1 (forms cycle)
- r # i
- [
- d1- # j=i-1 i
- [
- d;x r d;y # y(j) j x(j) i
- 4R
- d;x r d;y # y(i) i x(i) y(j) j x(j)
- 4R -d*v1+ # abs(delta y)+1 i x(i) j x(j)
- 5R4R -d*v1+ * # area i j
- d lm<S s.
- r1- d0<J
- ] dsJx +
- 1- d1<I
- ] dsIx
- [Part 1: ]n lmp
Advertisement
Add Comment
Please, Sign In to add comment