xrpn 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b45b0ae323940d1e746c3e7e506aa99b8bfcfe7b2150b3da8c0b52fa300d636b
4
- data.tar.gz: bf536a88ea59513dab40118fa6e33f3fcb8613dd766864ac34d2b65c5286ab01
3
+ metadata.gz: 8167dcb78197e227f824c68546005f21579dba7675cc9ded60392a5faea6b38c
4
+ data.tar.gz: a5de67d1bfc1fec03865523fdec1bfafb1595b383500012f7d242408c07d646d
5
5
  SHA512:
6
- metadata.gz: 5ce4089504e5db07a0178a8bfb81739f6ce01b3ec45d747fd7e7f1a9de9ebdec6806d467794870d26be1eac060af5cc6971706105e7cdc07837c59686bf2ec49
7
- data.tar.gz: e877789013f4b27f7ec0cff1f2ecbad7044871ebed1418615e825aa112036d333617c0c526511204123da180d8965dea943ed4e299251971e5b2f13729aa040d
6
+ metadata.gz: 266d7d75ea40f2d46f5a2923999bb104452fd5f8977ccd25d78b8ba060d4dc24fb10d8206aaa31622259e3b2a14e1c595df3e8ccdb2f92fdf055d00d7fc665e3
7
+ data.tar.gz: 563a67e0f13b95b2f590c9ad56a4383b36450184f376c8cef111ad211291901136f366d974516a5e6df9de6c384be28881b4df700357205d813df32f0717d1ca
data/README.md CHANGED
@@ -16,7 +16,7 @@ XRPN implements indirect addressing, self-modification and features well beyond
16
16
 
17
17
  You need Ruby installed to get XRPN to work.
18
18
 
19
- To install XRPN, you can do `gem install 'xrpn'` or by cloning this repository and run the script `INSTALL.sh`. It is only tested on Linux but should work well on Mac OS and BSD systems. If you are on Windows, please tell me if it works in that environment. The install script will put create a symbolic link in your home directory - named ".xrpn" to make it a hidden directory - pointing to the cloned repo. It will also attempt to add a symlink to "~/bin" to make it easy to run XRPN. If you install XRPN by cloning this repo, you also need to install the Ruby Gem tty-prompt: `gem install tty-prompt`. If you install via `gem install 'xrpn'`, then this dependency is automatically taken care of. The gem is slower on startup than running XRPN from this repo.
19
+ To install XRPN, you can do `gem install 'xrpn'` or by cloning this repository and run the script `INSTALL.sh`. It is only tested on Linux but should work well on Mac OS and BSD systems. If you are on Windows, please tell me if it works in that environment. The install script will put create a symbolic link in your home directory - named ".xrpn" to make it a hidden directory - pointing to the cloned repo. It will also attempt to add a symlink to "~/bin" to make it easy to run XRPN. If you install XRPN by cloning this repo, you also need to install the Ruby Gem tty-prompt: `gem install tty-prompt`. If you install via `gem install 'xrpn'`, then this dependency is automatically taken care of. The gem is slower on startup than running XRPN from this repo. Also, `speaker-test` must be installed to play tones, but this is preinstalled on most Lunux/BSD systems.
20
20
 
21
21
  ## Run
22
22
 
data/xcmd/beep CHANGED
@@ -1,7 +1,15 @@
1
1
  class XRPN
2
2
  # Sound the legendary HP-41 BEEP
3
3
  def beep
4
- `xdg-open ~/.xrpn/extra/beep41.wav`
4
+ t = [175, 197, 225, 263, 315, 394, 525, 629, 788, 1051]
5
+ begin
6
+ %x|speaker-test -t sine -f #{t[7]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
7
+ %x|speaker-test -t sine -f #{t[5]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
8
+ %x|speaker-test -t sine -f #{t[8]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
9
+ %x|speaker-test -t sine -f #{t[7]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
10
+ rescue
11
+ puts "speaker-test must be installed to play tones"
12
+ end
5
13
  end
6
14
  end
7
15
 
data/xcmd/pprg1 ADDED
@@ -0,0 +1,28 @@
1
+ class XRPN
2
+ # Print program
3
+ def pprg
4
+ page = @pg
5
+ pos = 0
6
+ if @a != ""
7
+ pr = "\"#{@a}\""
8
+ page, pos, prgm = locate_prg (pr)
9
+ if pos == nil
10
+ puts "No such program to print #{pr}"
11
+ return
12
+ end
13
+ end
14
+ @prg[page].each_index do |i|
15
+ next if i < pos
16
+ print "#{format('%02d', i + 1)}"
17
+ if @prg[page][i].downcase.match(/lbl/)
18
+ print "◆"
19
+ else
20
+ print " "
21
+ end
22
+ puts "#{@prg[page][i]}"
23
+ break if @prg[page][i] == "END"
24
+ end
25
+ end
26
+ end
27
+
28
+ # vim:ft=ruby:
data/xcmd/tone ADDED
@@ -0,0 +1,15 @@
1
+ class XRPN
2
+ # Sound a tone (0-9)
3
+ def tone (r)
4
+ r = r.to_i
5
+ return unless (0..9).include?(r)
6
+ t = [175, 197, 225, 263, 315, 394, 525, 629, 788, 1051]
7
+ begin
8
+ %x|speaker-test -t sine -f #{t[r]} -l 1 1> /dev/null 2>& 1 & sleep .28 && kill -9 $!|
9
+ rescue
10
+ puts "speaker-test must be installed to play tones"
11
+ end
12
+ end
13
+ end
14
+
15
+ # vim:ft=ruby:
data/xcmd/tonexy ADDED
@@ -0,0 +1,14 @@
1
+ class XRPN
2
+ # Sound a tone with frequency in X and length (in sec) in Y
3
+ def tonexy
4
+ f = @x.to_f
5
+ l = @y.to_f
6
+ begin
7
+ %x|speaker-test -t sine -f #{f} -l 1 1> /dev/null 2>& 1 & sleep #{l} && kill -9 $!|
8
+ rescue
9
+ puts "speaker-test must be installed to play tones"
10
+ end
11
+ end
12
+ end
13
+
14
+ # vim:ft=ruby:
data/xlib/debug_mode CHANGED
@@ -44,7 +44,7 @@ def debug_mode
44
44
  @p.flg = {}
45
45
  system("clear")
46
46
  when "R" # Reload all commands from the cmd directory
47
- read_cmd
47
+ read_xcmd
48
48
  puts "Commands reloaded."
49
49
  when "l" # Show current line
50
50
  @line = @p.prg[@p.pg][@p.pc]
data/xrpn.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xrpn'
3
- s.version = '1.3.2'
3
+ s.version = '1.3.3'
4
4
  s.licenses = ['Unlicense']
5
5
  s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
6
- s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.3.2: Bug fixes."
6
+ s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.3.3: Implemented tones. Bug fixes."
7
7
 
8
8
  s.authors = ["Geir Isene"]
9
9
  s.email = 'g@isene.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrpn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -28,7 +28,8 @@ description: 'A full programming language and environment extending the features
28
28
  the venerable HP calculator programmable calculators. With XRPN you can accomplish
29
29
  a wide range of modern programming tasks as well as running existing HP-41 FOCAL
30
30
  programs directly. XRPN gives modern life to tens of thousands of old HP calculator
31
- programs and opens the possibilities to many, many more. New in 1.3.2: Bug fixes.'
31
+ programs and opens the possibilities to many, many more. New in 1.3.3: Implemented
32
+ tones. Bug fixes.'
32
33
  email: g@isene.com
33
34
  executables:
34
35
  - xrpn
@@ -195,6 +196,7 @@ files:
195
196
  - xcmd/posfl
196
197
  - xcmd/pow
197
198
  - xcmd/pprg
199
+ - xcmd/pprg1
198
200
  - xcmd/pprgx
199
201
  - xcmd/pra
200
202
  - xcmd/prflags
@@ -269,6 +271,8 @@ files:
269
271
  - xcmd/tan
270
272
  - xcmd/tenx
271
273
  - xcmd/time
274
+ - xcmd/tone
275
+ - xcmd/tonexy
272
276
  - xcmd/tx
273
277
  - xcmd/version
274
278
  - xcmd/view