Here we will look at writing a script to test across a range of word lengths.

Eight words of five or less letters

  # range_of_word_lengths.rb

require 'cw'

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


Eight words ranging from 2 to 4 letters (15 WPM)

  # range_of_word_lengths_2.rb

require 'cw'

cw do
  comment "8 words having size between 2 and 4 letters (15 WPM)"
  shuffle
  wpm                 15
  no_shorter_than     2
  no_longer_than      4
  number_of_words     8
end


Two words having 8 or more letters (test_letters)

Copying very long words is tricky since you don’t get the thinking time allowed by the inter-word spacing!

  # range_of_word_lengths_3.rb

require 'cw'

cw do
  comment "2 words having at least 8 letters (15 WPM)"
  shuffle
  wpm                 15
  no_shorter_than     8
  number_of_words     2
end