Giter VIP home page Giter VIP logo

cw's Introduction

Gem Version Build Status Code Climate Dependency Status

Documentation:

CW Documentation

CW

CW is a program for learning and practicing Morse Code (CW). It is written in the form of a DSL in the Ruby language.

CW can read books (and remember where you are), rss feeds (your daily quotation for instance), common phrases, QSO codes etc, in addition to generating random words, letters, and numbers that possibly match some required pattern (i.e. words_beginning_with 'v').

CW also allows for real-time progress marking by indicating correct and incorrect characters and words copied in real-time. A follow mode also exists which prints the output just after it has played it (for `in head' practice).

CW is thoroughly documented, and includes a hands-on tutorial.

Installation:

gem install cw
cw example.rb

Note:

  • Requires Ruby 2+
  • Tested on OS X, and Linux.

Example CW Script

# example.rb

require 'cw'

cw do
  comment 'test single element letters'
  wpm 15
  load_alphabet :size, 1
  shuffle
end

cw do
  comment 'test 2 element letters'
  wpm 15
  load_alphabet :size, 2
  shuffle
end

cw do
  comment 'test less than 3 element letters'
  wpm 15
  load_alphabet :less_than, 3
  shuffle
end

cw do
  comment 'test 3 element letters'
  wpm 15
  load_alphabet :size, 3
  shuffle
end

cw do
  comment 'test less than 4 element letters'
  wpm 15
  load_alphabet :less_than, 4
  shuffle
end

cw do
  comment 'test 4 element letters'
  wpm 15
  load_alphabet :size, 4
  shuffle
end

cw do
  comment 'test alphabet vowels'
  wpm 15
  load_vowels
  shuffle
end

cw do
  comment 'test letters a..m'
  wpm 18
  load_alphabet("a".."m")
  shuffle
end

cw do
  comment 'test 8 words made with letters a..m - test by letter'
  wpm 18
  containing('a'..'m')
  shuffle
  word_count 8
end

cw do
  comment 'test letters n..z'
  wpm 18
  load_letters('n'..'z')
  shuffle
end

cw do
  comment 'test 8 words made with letters n..z - test by word'
  wpm 18
  containing('n'..'z')
  shuffle
  word_count 8
  test_words
end

cw do
  comment 'test numbers'
  wpm 20
  load_numbers
  shuffle
end

cw do
  comment 'test alphabet - repeat until correct'
  wpm 25
  load_alphabet
  shuffle
  repeat_word
end

cw do
  comment 'test 8 most common words no longer than 4 letters'
  wpm 20
  load_most_common_words
  shuffle
  no_longer_than 4
  word_count 8
end

cw do
  comment 'test 4 most common words no shorter than 4 letters'
  wpm 20
  load_most_common_words
  shuffle
  no_shorter_than 4
  word_count 8
end

cw do
  comment 'test 8 words including letter sequence "ing"'
  shuffle
  including('ing')
  word_size 6
end

cw do
  comment 'test 8 words having 6 letters - play each word twice'
  shuffle
  word_size 6
  word_count 8
  double_words
end

cw do
  comment 'test 8 words beginning with "qu" - repeat whole sequence once'
  wpm 20
  shuffle
  beginning_with 'qu'
  word_count 8
  repeat 1
end

cw do
  comment 'test 8 words ending with "tion" - test by word'
  wpm 15
  shuffle
  ending_with 'tion'
  word_count 8
  test_words
end

cw do
  comment 'read one sentence of book'
  wpm 20
  read_book(sentences: 1)
end

cw do
  comment 'read rss feed (quote of the day)'
  wpm 18
  read_rss(:quotation, 1)
end

cw do
  comment 'test 6 common cw abbreviations'
  wpm  15
  load_abbreviations
  shuffle
  word_count 6
end

cw do
  comment "test 8 Q codes by ear (no keyboard test)"
  wpm  20
  load_codes
  shuffle
  word_count 8
  print_words
end

cw do
  comment "test 8 words by ear - reveal words at end of test"
  wpm  20
  shuffle
  word_count 8
  reveal
end

cw do
  comment "reverse alphabet"
  wpm 20
  load_alphabet
  reverse
end

cw do
  comment "load my own word set"
  wpm 20
  load_text("test/my_words.txt")
  shuffle
  word_count 4
end

# See documentation for more details - and more commands.

puts 'done'

License

MIT License

cw's People

Contributors

mjago avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.