xrpn 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/xrpn +5 -5
- data/lib/xrpn_load.rb +2 -0
- data/xrpn.gemspec +2 -3
- metadata +3 -302
- data/cmd/abs +0 -7
- data/cmd/acos +0 -10
- data/cmd/adate +0 -12
- data/cmd/adateiso +0 -13
- data/cmd/add +0 -9
- data/cmd/adv +0 -7
- data/cmd/agsub +0 -8
- data/cmd/aleng +0 -8
- data/cmd/almcat +0 -7
- data/cmd/almnow +0 -7
- data/cmd/anum +0 -10
- data/cmd/aoff +0 -7
- data/cmd/aon +0 -7
- data/cmd/appchr +0 -13
- data/cmd/apprec +0 -13
- data/cmd/arcl +0 -22
- data/cmd/arcli +0 -7
- data/cmd/arclrec +0 -30
- data/cmd/arot +0 -13
- data/cmd/ashf +0 -7
- data/cmd/asin +0 -10
- data/cmd/asroom +0 -7
- data/cmd/asto +0 -21
- data/cmd/asub +0 -8
- data/cmd/atan +0 -10
- data/cmd/atime +0 -26
- data/cmd/atime24 +0 -21
- data/cmd/atox +0 -9
- data/cmd/aview +0 -7
- data/cmd/aviewc +0 -7
- data/cmd/beep +0 -7
- data/cmd/bindec +0 -8
- data/cmd/cat +0 -26
- data/cmd/cf +0 -7
- data/cmd/chs +0 -7
- data/cmd/cla +0 -7
- data/cmd/clalma +0 -7
- data/cmd/clalmx +0 -7
- data/cmd/cld +0 -6
- data/cmd/clear +0 -7
- data/cmd/clfl +0 -13
- data/cmd/clk12 +0 -7
- data/cmd/clk24 +0 -7
- data/cmd/clkeys +0 -7
- data/cmd/clock +0 -7
- data/cmd/clp +0 -8
- data/cmd/clralms +0 -7
- data/cmd/clrg +0 -7
- data/cmd/clrgx +0 -12
- data/cmd/cls +0 -12
- data/cmd/clst +0 -10
- data/cmd/clx +0 -8
- data/cmd/cmdadd +0 -7
- data/cmd/cmddel +0 -7
- data/cmd/correct +0 -7
- data/cmd/cos +0 -10
- data/cmd/crflas +0 -9
- data/cmd/crfld +0 -9
- data/cmd/cube +0 -8
- data/cmd/d_r +0 -8
- data/cmd/date +0 -8
- data/cmd/dateplus +0 -12
- data/cmd/ddate +0 -11
- data/cmd/dec +0 -7
- data/cmd/decbin +0 -8
- data/cmd/dechex +0 -8
- data/cmd/decoct +0 -8
- data/cmd/deg +0 -7
- data/cmd/degq +0 -7
- data/cmd/delchr +0 -14
- data/cmd/delrec +0 -12
- data/cmd/divide +0 -9
- data/cmd/dmy +0 -7
- data/cmd/dot +0 -7
- data/cmd/dow +0 -9
- data/cmd/drop +0 -7
- data/cmd/dropy +0 -7
- data/cmd/dse +0 -40
- data/cmd/ed +0 -7
- data/cmd/emdir +0 -7
- data/cmd/emdirx +0 -14
- data/cmd/emroom +0 -7
- data/cmd/end +0 -9
- data/cmd/eng +0 -9
- data/cmd/enter +0 -8
- data/cmd/exp +0 -9
- data/cmd/expx1 +0 -9
- data/cmd/fact +0 -9
- data/cmd/fc +0 -7
- data/cmd/fcc +0 -8
- data/cmd/fcs +0 -8
- data/cmd/fix +0 -9
- data/cmd/fixq +0 -7
- data/cmd/flsize +0 -7
- data/cmd/frc +0 -8
- data/cmd/fs +0 -7
- data/cmd/fsc +0 -8
- data/cmd/fss +0 -8
- data/cmd/geir +0 -11
- data/cmd/getas +0 -7
- data/cmd/getfile +0 -12
- data/cmd/getfilea +0 -11
- data/cmd/getkey +0 -9
- data/cmd/getkeyx +0 -10
- data/cmd/getp +0 -13
- data/cmd/getr +0 -13
- data/cmd/getrec +0 -8
- data/cmd/getrx +0 -17
- data/cmd/getsub +0 -7
- data/cmd/getweb +0 -12
- data/cmd/getx +0 -12
- data/cmd/grad +0 -7
- data/cmd/gsb +0 -7
- data/cmd/gto +0 -23
- data/cmd/help +0 -14
- data/cmd/hexdec +0 -8
- data/cmd/hms +0 -12
- data/cmd/hmsminus +0 -14
- data/cmd/hmsplus +0 -13
- data/cmd/hr +0 -11
- data/cmd/inschr +0 -14
- data/cmd/insrec +0 -12
- data/cmd/int +0 -8
- data/cmd/invf +0 -7
- data/cmd/isg +0 -40
- data/cmd/lastx +0 -8
- data/cmd/lbl +0 -6
- data/cmd/lift +0 -8
- data/cmd/ln +0 -8
- data/cmd/ln1x +0 -8
- data/cmd/log +0 -8
- data/cmd/mdy +0 -7
- data/cmd/mean +0 -11
- data/cmd/mod +0 -13
- data/cmd/multiply +0 -9
- data/cmd/oct +0 -7
- data/cmd/octdec +0 -8
- data/cmd/off +0 -8
- data/cmd/on +0 -7
- data/cmd/p_r +0 -13
- data/cmd/pack +0 -7
- data/cmd/page +0 -13
- data/cmd/pagedel +0 -8
- data/cmd/pageq +0 -7
- data/cmd/pageswap +0 -8
- data/cmd/pasn +0 -7
- data/cmd/pcat +0 -14
- data/cmd/pclps +0 -12
- data/cmd/percent +0 -9
- data/cmd/percentch +0 -9
- data/cmd/pi +0 -8
- data/cmd/posa +0 -23
- data/cmd/posfl +0 -26
- data/cmd/pow +0 -9
- data/cmd/pprg +0 -27
- data/cmd/pprgx +0 -33
- data/cmd/pra +0 -7
- data/cmd/prflags +0 -8
- data/cmd/prompt +0 -8
- data/cmd/prp +0 -7
- data/cmd/prregs +0 -8
- data/cmd/prstk +0 -10
- data/cmd/prx +0 -7
- data/cmd/prxm +0 -21
- data/cmd/pse +0 -7
- data/cmd/psize +0 -7
- data/cmd/purfl +0 -14
- data/cmd/r_d +0 -8
- data/cmd/r_p +0 -18
- data/cmd/rad +0 -7
- data/cmd/rand +0 -10
- data/cmd/rcl +0 -23
- data/cmd/rclaf +0 -7
- data/cmd/rclflag +0 -16
- data/cmd/rclpt +0 -8
- data/cmd/rclpta +0 -16
- data/cmd/rclsw +0 -7
- data/cmd/rdn +0 -7
- data/cmd/recip +0 -8
- data/cmd/regmove +0 -18
- data/cmd/regswap +0 -19
- data/cmd/reload +0 -7
- data/cmd/reszfl +0 -7
- data/cmd/rnd +0 -8
- data/cmd/root +0 -9
- data/cmd/rtn +0 -12
- data/cmd/rubycmd +0 -7
- data/cmd/runsw +0 -7
- data/cmd/rup +0 -7
- data/cmd/saveas +0 -7
- data/cmd/savep +0 -7
- data/cmd/saver +0 -24
- data/cmd/saverx +0 -31
- data/cmd/savex +0 -10
- data/cmd/savexm +0 -7
- data/cmd/sci +0 -9
- data/cmd/sdev +0 -11
- data/cmd/seekpt +0 -10
- data/cmd/seekpta +0 -7
- data/cmd/sep +0 -7
- data/cmd/setaf +0 -7
- data/cmd/setsw +0 -7
- data/cmd/sf +0 -7
- data/cmd/shellcmd +0 -7
- data/cmd/sign +0 -19
- data/cmd/sin +0 -10
- data/cmd/size +0 -7
- data/cmd/sizeq +0 -7
- data/cmd/sminus +0 -20
- data/cmd/splus +0 -20
- data/cmd/sqr +0 -8
- data/cmd/sqrt +0 -8
- data/cmd/sreg +0 -7
- data/cmd/sregq +0 -7
- data/cmd/stdivide +0 -22
- data/cmd/stmultiply +0 -22
- data/cmd/sto +0 -21
- data/cmd/stoflag +0 -13
- data/cmd/stop +0 -7
- data/cmd/stopsw +0 -7
- data/cmd/stplus +0 -22
- data/cmd/stsubtract +0 -22
- data/cmd/subtract +0 -9
- data/cmd/sw +0 -7
- data/cmd/swap +0 -7
- data/cmd/swpt +0 -7
- data/cmd/tan +0 -10
- data/cmd/tenx +0 -8
- data/cmd/time +0 -8
- data/cmd/tx +0 -7
- data/cmd/version +0 -7
- data/cmd/view +0 -7
- data/cmd/writefile +0 -12
- data/cmd/xeq +0 -21
- data/cmd/xeq0 +0 -7
- data/cmd/xeqnn +0 -9
- data/cmd/xeqy +0 -7
- data/cmd/xf +0 -20
- data/cmd/xgt0 +0 -7
- data/cmd/xgteq0 +0 -7
- data/cmd/xgteqnn +0 -9
- data/cmd/xgteqy +0 -7
- data/cmd/xgtnn +0 -9
- data/cmd/xgty +0 -7
- data/cmd/xlt0 +0 -7
- data/cmd/xlteq0 +0 -7
- data/cmd/xlteqnn +0 -9
- data/cmd/xlteqy +0 -7
- data/cmd/xltnn +0 -9
- data/cmd/xlty +0 -7
- data/cmd/xmexistq +0 -15
- data/cmd/xmfileq +0 -7
- data/cmd/xneq0 +0 -7
- data/cmd/xneqnn +0 -9
- data/cmd/xneqy +0 -7
- data/cmd/xnn +0 -21
- data/cmd/xtoa +0 -7
- data/cmd/xy +0 -7
- data/cmd/xyzalm +0 -7
- data/lib/_xrpn_version.rb +0 -5
- data/lib/bei.rb +0 -18
- data/lib/check.rb +0 -26
- data/lib/conditional.rb +0 -10
- data/lib/convert_base.rb +0 -8
- data/lib/debug_mode.rb +0 -124
- data/lib/dtparse.rb +0 -10
- data/lib/error.rb +0 -10
- data/lib/fact.rb +0 -7
- data/lib/getpt.rb +0 -7
- data/lib/help.rb +0 -12
- data/lib/hp_41.rb +0 -83
- data/lib/ind.rb +0 -21
- data/lib/load_xm.rb +0 -28
- data/lib/locate_prg.rb +0 -32
- data/lib/numeric.rb +0 -62
- data/lib/numformat.rb +0 -12
- data/lib/optparse.rb +0 -23
- data/lib/read_cmd.rb +0 -12
- data/lib/read_state.rb +0 -6
- data/lib/save_state.rb +0 -18
- data/lib/save_xm.rb +0 -5
- data/lib/setpt.rb +0 -5
- data/lib/string.rb +0 -28
- data/lib/theme_dark.rb +0 -10
- data/lib/theme_light.rb +0 -10
- data/lib/xrpn_class.rb +0 -34
data/cmd/p_r
DELETED
data/cmd/pack
DELETED
data/cmd/page
DELETED
data/cmd/pagedel
DELETED
data/cmd/pageq
DELETED
data/cmd/pageswap
DELETED
data/cmd/pasn
DELETED
data/cmd/pcat
DELETED
data/cmd/pclps
DELETED
data/cmd/percent
DELETED
data/cmd/percentch
DELETED
data/cmd/pi
DELETED
data/cmd/posa
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def posa
|
3
|
-
@l = @x
|
4
|
-
if @x.is_a? String
|
5
|
-
begin
|
6
|
-
@x = @a.index(@x) + 1
|
7
|
-
rescue
|
8
|
-
@x = 0.0
|
9
|
-
end
|
10
|
-
elsif @x.to_i.between?(0,255)
|
11
|
-
i = 1
|
12
|
-
@a.each_char do |c|
|
13
|
-
if c.ord == @x.to_i
|
14
|
-
@x = i
|
15
|
-
return
|
16
|
-
end
|
17
|
-
i += 1
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# vim:ft=ruby:
|
data/cmd/posfl
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def posfl
|
3
|
-
if @xmcont[0][0] == ""
|
4
|
-
return
|
5
|
-
else
|
6
|
-
r = @xmcont[0][3].to_i + 1
|
7
|
-
p r
|
8
|
-
until r == @xmcont.length do
|
9
|
-
m = @xmcont[r] =~ Regexp.new(@a)
|
10
|
-
p m
|
11
|
-
if m
|
12
|
-
lift
|
13
|
-
@xmcont[0][0] = (r - 1) + (m / 1000.0)
|
14
|
-
@x = @xmcont[0][0]
|
15
|
-
savexm
|
16
|
-
return
|
17
|
-
end
|
18
|
-
r += 1
|
19
|
-
end
|
20
|
-
lift
|
21
|
-
@x = -1.0
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
# vim:ft=ruby:
|
data/cmd/pow
DELETED
data/cmd/pprg
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def pprg
|
3
|
-
page = @pg
|
4
|
-
pos = 0
|
5
|
-
if @a != ""
|
6
|
-
pr = "\"#{@a}\""
|
7
|
-
page, pos, prgm = locate_prg (pr)
|
8
|
-
if pos == nil
|
9
|
-
puts "No such program to print."
|
10
|
-
return
|
11
|
-
end
|
12
|
-
end
|
13
|
-
@prg[page].each_index do |i|
|
14
|
-
next if i < pos
|
15
|
-
print "#{format('%02d', i + 1)}"
|
16
|
-
if @prg[page][i].downcase.match(/lbl/)
|
17
|
-
print "◆"
|
18
|
-
else
|
19
|
-
print " "
|
20
|
-
end
|
21
|
-
puts "#{@prg[page][i]}"
|
22
|
-
break if @prg[page][i] == "END"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# vim:ft=ruby:
|
data/cmd/pprgx
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def pprgx
|
3
|
-
# Print current program from Y to X (relative to current line if Y is negative
|
4
|
-
s = @y.to_i
|
5
|
-
e = @x.to_i
|
6
|
-
if (s == 0 and e == 0)
|
7
|
-
e = @prg[@pg].length
|
8
|
-
end
|
9
|
-
if s < 0
|
10
|
-
s = @pc + s
|
11
|
-
e = @pc + e + 1
|
12
|
-
end
|
13
|
-
s = 0 if s < 0
|
14
|
-
e = @prg[@pg].length if e > @prg[@pg].length
|
15
|
-
out = ""
|
16
|
-
@prg[@pg].each_index do |i|
|
17
|
-
next if i < s
|
18
|
-
break if i > e - 1
|
19
|
-
out += "#{format('%02d', i + 1)}"
|
20
|
-
if @prg[@pg][i].downcase.match(/lbl/)
|
21
|
-
out += "◆"
|
22
|
-
else
|
23
|
-
out += " "
|
24
|
-
end
|
25
|
-
out += "#{@prg[@pg][i]}\n"
|
26
|
-
break if @prg[@pg][i] == "END"
|
27
|
-
end
|
28
|
-
puts out
|
29
|
-
File.write(Dir.home + "/.xrpn/print/" + @a, out) if @a != ""
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# vim:ft=ruby:
|
data/cmd/pra
DELETED
data/cmd/prflags
DELETED
data/cmd/prompt
DELETED
data/cmd/prp
DELETED
data/cmd/prregs
DELETED
data/cmd/prstk
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def prstk
|
3
|
-
puts "T = ".c_t + numformat(@t).c_t(1) + " α = ".c_a + @a.to_s.c_a(1)
|
4
|
-
puts "Z = ".c_z + numformat(@z).c_z(1)
|
5
|
-
puts "Y = ".c_y + numformat(@y).c_y(1)
|
6
|
-
puts "X = ".c_x + numformat(@x).c_x(1) + " L = ".c_l + numformat(@l).c_l(1)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
# vim:ft=ruby:
|
data/cmd/prx
DELETED
data/cmd/prxm
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def prxm
|
3
|
-
# Print content of current XM file
|
4
|
-
out = ""
|
5
|
-
@xmcont.each_index do |i|
|
6
|
-
if i == 0
|
7
|
-
out += "File = #{@xmcont[0][0]}\n"
|
8
|
-
out += "Type = #{@xmcont[0][1]}\n"
|
9
|
-
out += "Pointer = #{@xmcont[0][3].to_s}\n"
|
10
|
-
next
|
11
|
-
end
|
12
|
-
out += "#{format('%03d', i - 1)}"
|
13
|
-
out += " "
|
14
|
-
out += "#{@xmcont[i].to_s}\n"
|
15
|
-
end
|
16
|
-
puts out
|
17
|
-
File.write(Dir.home + "/.xrpn/print/" + @a, out) if @a != ""
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# vim:ft=ruby:
|
data/cmd/pse
DELETED
data/cmd/psize
DELETED
data/cmd/purfl
DELETED
data/cmd/r_d
DELETED
data/cmd/r_p
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def r_p
|
3
|
-
@l = @x
|
4
|
-
x = @x
|
5
|
-
y = @y
|
6
|
-
@x = Math::sqrt(x*x + y*y)
|
7
|
-
@y = Math::atan(y/x)
|
8
|
-
if x < 0 # Q2 & Q3
|
9
|
-
@y += Math::PI
|
10
|
-
elsif x >= 0 and y < 0 # Q4
|
11
|
-
@y += 2 * Math::PI
|
12
|
-
end
|
13
|
-
@y = @y * 180 / Math::PI if @deg == "deg"
|
14
|
-
@y = @y * 200 / Math::PI if @deg == "grad"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# vim:ft=ruby:
|
data/cmd/rad
DELETED
data/cmd/rand
DELETED
data/cmd/rcl
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def rcl (r)
|
3
|
-
x = false
|
4
|
-
case r.downcase
|
5
|
-
when "x"
|
6
|
-
x = @x
|
7
|
-
when "y"
|
8
|
-
x = @y
|
9
|
-
when "z"
|
10
|
-
x = @z
|
11
|
-
when "t"
|
12
|
-
x = @t
|
13
|
-
end
|
14
|
-
lift
|
15
|
-
x ? @x = x : @x = @reg[r]
|
16
|
-
if @x == nil
|
17
|
-
@reg[r] = 0.0
|
18
|
-
@x = 0.0
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# vim:ft=ruby:
|
data/cmd/rclaf
DELETED
data/cmd/rclflag
DELETED
data/cmd/rclpt
DELETED
data/cmd/rclpta
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def rclpta
|
3
|
-
f = Dir.home + "/.xrpn/data/" + @a
|
4
|
-
if File.exist?(f + ".as")
|
5
|
-
@xmcont = JSON.parse(File.read(f + ".as"))
|
6
|
-
@x = @xmcont[0][3]
|
7
|
-
elsif File.exist?(f + ".da")
|
8
|
-
@xmcont = JSON.parse(File.read(f + ".da"))
|
9
|
-
@x = @xmcont[0][3]
|
10
|
-
else
|
11
|
-
return "No such file: #{@a}"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
# vim:ft=ruby:
|
data/cmd/rclsw
DELETED
data/cmd/rdn
DELETED
data/cmd/recip
DELETED
data/cmd/regmove
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def regmove
|
3
|
-
c = @x
|
4
|
-
b = c.to_i
|
5
|
-
e = (1000 * (c - b)).to_i
|
6
|
-
n = ((1000 * c).modulo(1).round(3) * 1000).to_i
|
7
|
-
n.times do |i|
|
8
|
-
f = (b + i).to_s
|
9
|
-
f = "%02d" % [f] if f == f.to_i.to_s
|
10
|
-
t = (e + i).to_s
|
11
|
-
t = "%02d" % [t] if t == t.to_i.to_s
|
12
|
-
@reg[f] = 0 if @reg[f] == nil
|
13
|
-
@reg[t] = @reg[f]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# vim:ft=ruby:
|
data/cmd/regswap
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
def regswap
|
3
|
-
c = @x
|
4
|
-
b = c.to_i
|
5
|
-
e = (1000 * (c - b)).to_i
|
6
|
-
n = ((1000 * c).modulo(1).round(3) * 1000).to_i
|
7
|
-
n.times do |i|
|
8
|
-
f = (b + i).to_s
|
9
|
-
f = "%02d" % [f] if f == f.to_i.to_s
|
10
|
-
t = (e + i).to_s
|
11
|
-
t = "%02d" % [t] if t == t.to_i.to_s
|
12
|
-
@reg[f] = 0 if @reg[f] == nil
|
13
|
-
@reg[t] = 0 if @reg[t] == nil
|
14
|
-
@reg[t], @reg[f] = @reg[f], @reg[t]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
# vim:ft=ruby:
|
data/cmd/reload
DELETED
data/cmd/reszfl
DELETED
data/cmd/rnd
DELETED
data/cmd/root
DELETED
data/cmd/rtn
DELETED
data/cmd/rubycmd
DELETED
data/cmd/runsw
DELETED
data/cmd/rup
DELETED
data/cmd/saveas
DELETED