Description of Curta Program:
Opening Stuff
Open line required by RPN; specifies version, # of
variables, and name.
RPN.2.e+1 \Curta
Comments stating what the
variables are for.
\
\ a - speed factor
\ b - accum dist
\ c - accum time
\ d - cents (60) or secs (100)
\ e - delta distance
\
Comments giving you a heads up and two of the functions.
\ X - set var
\ x - retrv var & push on stack
\
Function Definitions
\\ functions
Functions s and t convert
between cents and seconds
[s]Vv#'100'/w#'60'*vwv#'100'/w#'100'*-+vf#'.6'/+;
[t]Vv#'60'/w#'100'*v#'60'/w#'60'*nvw++vf#'.6'*+;
Function h computes new
time based on delta distance (e) and speed factor (a), adds it to the
accumulated time (c) then saves the result as the new accumulated time (c).
\ new time - computes new time
[h]xexa*xc+Xc;
Function i adds the delta
distance (e) to the accumulated distance (b) and saves it as the new accumulated
distance.
\ updates accum. distance
[i]xexb+Xb;
m enables cents mode by
saving 100 to units (d)
\ set cents
[m]#'100'Xdxd;
n enables seconds mode by
saving 60 to units (d)
\ set secs
[n]#'60'Xdxd;
Function d retrieves the
accumulated time value(b) and puts in on the top of the stack (TOS)
then calls function x
\ Display - push accum. miles & time
[d]xbCx;
Function retreives
accumulated time (c) and converts it to hours and minutes instead of just
minutes
\ mmm.xx -> hhmm.xx
[x]xcw#'60'/#'100'*xcw#'60'/w#'100'*Vv-#'.6'*v+xcfxd*#'100'/+;
Function y converts between
time in hours and minutes into minutes (and fractional minutes).
\ hhmm.xx -> mmm.xx
[y]Vv#'100'/f#'100'*v#'100'/w#'60'*+;
Functions z is a safety to
make sure you don't try to compute times without first setting a speed.
\ Verify speed is set
[z]0xa=0(D'Must set CAST|':);
Button Definitions
Functions z is a safety
to make sure you don't try to compute times without first setting a speed.
\
\\ buttons
"Curta"
"+1"Czd1#'1'XeCiChCd;
"+.1"Czd1#'.1'XeCiChCd;
"D"Czxb-XeCiChCd;
"-.1"Czd1#'-.1'XeCiChCd;
"-1"Czd1#'-1'XeCiChCd;
Functions z is a safety
to make sure you don't try to compute times without first setting a speed.
~
"P/G"D'Pause/Gain|pause|gain|etc|'c(xd/xc+Xc:xd/xc-Xc:)Cd;
\"CAST"0xd=0(D'Must set units|':0=0(D'speed must not be zero|':#'60'r2/Xaxa));
"CAST"#'60'r2/Xaxa;
Functions z is a safety
to make sure you don't try to compute times without first setting a speed.
~
"sp"0xa=0(D'speed not set|':#'60'xa/);
"D"xb;
"t"Cd;
"u"xd;
"d"xe;
Functions z is a safety
to make sure you don't try to compute times without first setting a speed.
~
"Clear"D'Clear (does not clear units)|yes|no|'c(d10Xa0Xb0Xc0Xexe:);
"Set"D'Set|D|T|cents|secs|esc|'c(XbCd:CyXcCd:Cm:Cn:);