Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[Ruby] Develop a Morse Code Learning Gem & Beep...

oguressive
December 17, 2024

[Ruby] Develop a Morse Code Learning Gem & Beep from Strings

# About this Deck

This deck introduces how to trigger beep sounds from strings in a Ruby environment and demonstrates the development of a Morse code learning gem.

## Triggering Beep Sounds from Terminal Strings

In this section, I'll explore how to convert textual input into audible beep sounds directly in the terminal using Ruby. By mapping characters to specific beep patterns, you can provide audible feedback or signals as part of your Ruby application.

## Develop a Morse Code Learning Gem: Morsby

**Morsby** is a versatile Morse code tool designed for both learners and practitioners. It supports a wide range of character sets including alphabets (A-Z), digits (0-9), punctuation, Q-codes, CW abbreviations, and even Japanese Wabun Morse.

**Key Features:**
- **Learning Mode:** Master the basics through guided practice, then test your skills with quizzes.
- **Instant Conversion:** Quickly transform any input string into Morse code on-the-fly.
- **Language Support:** Utilize English mode (`--lang en`) for English output.(Default is Japanese output)
- **Pro Mode:** Increase playback speed (`--pro`) to challenge yourself and improve proficiency.

Discover more on GitHub: https://github.com/oguressive/morsby

### Example

morsby "Rubyist"
morsby --pro "HELLO RUBYIST"
morsby -learn
morsby -learn --lang en
morsby -learn --pro
morsby -learn --pro --lang en

oguressive

December 17, 2024
Tweet

Other Decks in Technology

Transcript

  1. puts ”\a” するとピープ音が鳴る ターミナルで puts ”\a” するとピープ音が鳴る なぜ?? case 'a':

    /* alarm(bell) */ return '\007'; https://github.com/ruby/ruby/blob/master/parse.y#L8124-L8125
  2. - `morsby -learn` : 学習モード - 基礎、Q符号、CW略号、ランダムクイズ(符号=>文字、音声=>文字) - `morsby "xxxx"`

    : モールス信号を音声出力するモード (文字列→音声) - `morsby "xxxx" -- pro` : 高速再生用のオプション - `morsby -learn -- lang en` : 英語対応用のオプション morsby