-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.rb
221 lines (191 loc) · 3.16 KB
/
example.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
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
cw do
comment "test 5 callsigns"
wpm 20
callsign * 5
end
puts "cq de callsign k 5 times"
5.times do
cw do
comment 'random frequency, random wpm callsign with pre and postamble'
frequency 500 + rand(400)
wpm 25 + rand(10)
callsign
(words.unshift "cqde") << 'k'
print_letters
end
end
# See documentation for more details - and more commands.
puts 'done'