||:@include: lib/rpn.nv |:: rotate $direction :@rpn data: $n| :dial: $n |:: rotate right :dial: 99| :dial: 0 |:: rotate left :dial: 0| :dial: 99 |:: rotate right? :dial: $n| :@rpn: ($n 1 +) |:: rotate left? :dial: $n| :@rpn: ($n 1 -) |:: rotate $direction 0 times| |:: rotate $direction $n times :@rpn data: $x| :: rotate $direction $x times |:: rotate $direction $n times? :next:| :@rpn: ($n 1 -) |:: rotate $direction $n times?| :: rotate $direction :next: |:: read the rotations? :rotations: $direction $amount| :: rotate $direction $amount times :: if the dial is 0, increment the code |:: read the rotations| |:: if the dial is 0, increment the code :@rpn data: $n| :code: $n |:: if the dial is 0, increment the code? :dial: 0? :code: $n| :@rpn: ($n 1 +) |:: if the dial is 0, increment the code| ||:: read the rotations :dial: 50 :code: 0 :rotations: . left 68 . left 30 . right 48 . left 5 . right 60 . left 55 . left 1 . left 99 . right 14 . left 82