Martyn Jago
by Martyn Jago
1 min read

Categories

Tags

I have open-sourced a fairly comprehensive morse code tutor I have written (and used) in the Ruby language. It goes by the name of CW.

In case you were wondering, CW stands for Continuous Wave. When communicating by morse code you are effectively interrupting a continuous-wave signal with a key to generate dots and dashes. For this reason, the name CW became synonymous with morse code.

cw docs
CW Documentation

DSL

The tutor is in the form of domain-specific language and a couple of simple CW test examples are shown below:


Ex.1 Play a daily quotation from an rss feed (18 words per minute / 12 effective words per minute)

require 'cw'

cw do
  comment 'read daily quotation via RSS feed (1 article)'
  read_rss(:quotation, 1)
  wpm 18
  ewpm 12
end


Ex.2 Play eight words having five or less letters (18 words per minute)

require 'cw'

cw do
  comment "Eight words, five or less letters (18 WPM)"
  shuffle
  no_longer_than 5
  word_count     8
  wpm            18
end


Documention

I have documented CW using the excellent Jekyll static website generator, and a theme called Documentation theme jekyll.