timequiz 0.2.1 → 0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/html/timequiz.html +300 -482
- data/doc/man/timequiz.6.gz +0 -0
- data/doc/pdf/timequiz.pdf +0 -0
- data/doc/rst/timequiz.rst +87 -93
- data/lib/adder.rb +6 -3
- data/lib/console.rb +9 -5
- data/lib/events.rb +5 -0
- data/lib/version.rb +3 -3
- data/timequiz.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4dfbd11aa927e4fa19f97df85c57fcb4bfbcd54d732629af6a2a97686e1b8725
|
|
4
|
+
data.tar.gz: 5e90386c572b4b33dac75535a3fceea7ac8017ca147af10e0a074664a750f47d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8dadc3a9eba2c6429771d695a53aabc56cb6d09b47b5fdf902364bd54d02939a3c85b41a201e99b70d211a686322a13791e93508f1db5b7cfbcef32734c95b1
|
|
7
|
+
data.tar.gz: 86b49f8edb20261267fe989d4e51d721966df45576ecbf6dafeb0a975631ee64a169b26c92ea409e6a52b772c02e4cedb2004a528aca300a0bc765fa61c2d184
|
data/doc/html/timequiz.html
CHANGED
|
@@ -1,516 +1,334 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
3
|
<head>
|
|
5
|
-
<meta
|
|
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
|
-
margin-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
margin-
|
|
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
|
-
div.abstract p.topic-title {
|
|
72
|
-
font-weight: bold ;
|
|
73
|
-
text-align: center }
|
|
74
|
-
|
|
75
|
-
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
76
|
-
div.hint, div.important, div.note, div.tip, div.warning {
|
|
77
|
-
margin: 2em ;
|
|
78
|
-
border: medium outset ;
|
|
79
|
-
padding: 1em }
|
|
80
|
-
|
|
81
|
-
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
82
|
-
div.important p.admonition-title, div.note p.admonition-title,
|
|
83
|
-
div.tip p.admonition-title {
|
|
84
|
-
font-weight: bold ;
|
|
85
|
-
font-family: sans-serif }
|
|
86
|
-
|
|
87
|
-
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
88
|
-
div.danger p.admonition-title, div.error p.admonition-title,
|
|
89
|
-
div.warning p.admonition-title, .code .error {
|
|
90
|
-
color: red ;
|
|
91
|
-
font-weight: bold ;
|
|
92
|
-
font-family: sans-serif }
|
|
93
|
-
|
|
94
|
-
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
95
|
-
compound paragraphs.
|
|
96
|
-
div.compound .compound-first, div.compound .compound-middle {
|
|
97
|
-
margin-bottom: 0.5em }
|
|
98
|
-
|
|
99
|
-
div.compound .compound-last, div.compound .compound-middle {
|
|
100
|
-
margin-top: 0.5em }
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
div.dedication {
|
|
104
|
-
margin: 2em 5em ;
|
|
105
|
-
text-align: center ;
|
|
106
|
-
font-style: italic }
|
|
107
|
-
|
|
108
|
-
div.dedication p.topic-title {
|
|
109
|
-
font-weight: bold ;
|
|
110
|
-
font-style: normal }
|
|
111
|
-
|
|
112
|
-
div.figure {
|
|
113
|
-
margin-left: 2em ;
|
|
114
|
-
margin-right: 2em }
|
|
115
|
-
|
|
116
|
-
div.footer, div.header {
|
|
117
|
-
clear: both;
|
|
118
|
-
font-size: smaller }
|
|
119
|
-
|
|
120
|
-
div.line-block {
|
|
121
|
-
display: block ;
|
|
122
|
-
margin-top: 1em ;
|
|
123
|
-
margin-bottom: 1em }
|
|
124
|
-
|
|
125
|
-
div.line-block div.line-block {
|
|
126
|
-
margin-top: 0 ;
|
|
127
|
-
margin-bottom: 0 ;
|
|
128
|
-
margin-left: 1.5em }
|
|
129
|
-
|
|
130
|
-
div.sidebar {
|
|
131
|
-
margin: 0 0 0.5em 1em ;
|
|
132
|
-
border: medium outset ;
|
|
133
|
-
padding: 1em ;
|
|
134
|
-
background-color: #ffffee ;
|
|
135
|
-
width: 40% ;
|
|
136
|
-
float: right ;
|
|
137
|
-
clear: right }
|
|
4
|
+
<meta name="generator" content=
|
|
5
|
+
"HTML Tidy für Linux, Version 5.8.0" />
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<title>Timequiz</title>
|
|
8
|
+
<style type="text/css">
|
|
9
|
+
/*<![CDATA[*/
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
:Author: Michael Uplawski
|
|
13
|
+
:Contact: michael.uplawski@uplawski.eu
|
|
14
|
+
:License: WTFPL 2.0, see http://www.wtfpl.net/about/
|
|
15
|
+
|
|
16
|
+
Stylesheet for use with Docutils.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
body {
|
|
20
|
+
background-color:#200030;
|
|
21
|
+
font-family: Verdana,Helvetica,Univers;
|
|
22
|
+
color:#f0f0f0;
|
|
23
|
+
color:#f0f0f0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
h1 {color:cyan;font-size:1.5em;}
|
|
27
|
+
h1.title {color:#a0a0f0;font-size:2em;}
|
|
28
|
+
h2 {color:#ffffa0;}
|
|
29
|
+
|
|
30
|
+
p, ul.simple, ol.simple, dt {margin-left:2em;}
|
|
31
|
+
p.first {font-weight:bold;}
|
|
32
|
+
dd {margin-left:4em;}
|
|
33
|
+
table {
|
|
34
|
+
border: 0.5pt dotted #ffa050;
|
|
35
|
+
margin-left:2em;
|
|
36
|
+
border-radius:1em;
|
|
37
|
+
}
|
|
38
|
+
td {color:#f0f080;}
|
|
39
|
+
|
|
40
|
+
/* correct left margin of nested block tags*/
|
|
41
|
+
dd p, li p {margin-left:0;}
|
|
42
|
+
dd * ul {margin-left:0 ! important; }
|
|
43
|
+
dd ul {margin-left:0 ! important; }
|
|
44
|
+
dd dl dt, dd dl dd {margin-left:0 ! important;}
|
|
45
|
+
dt {font-weight:bold;}
|
|
46
|
+
dt, dd {color:#f0f0f0}
|
|
47
|
+
|
|
48
|
+
tt.docutils {color:#000080;
|
|
49
|
+
background-color:#a080a0;
|
|
50
|
+
padding-left:3px;
|
|
51
|
+
padding-right:3px;
|
|
52
|
+
white-space:nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
a.external {color:#ff90ff;}
|
|
56
|
+
|
|
57
|
+
blockquote {background-color:#ffc090;
|
|
58
|
+
padding:0.5em;
|
|
59
|
+
border-radius:0.5em;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/*]]>*/
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main id="timequiz">
|
|
68
|
+
<h1 class="title">TIMEQUIZ</h1>
|
|
138
69
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
font-size: medium }
|
|
70
|
+
<p class="subtitle" id="play-a-history-quiz-game">Play a
|
|
71
|
+
history-quiz game</p>
|
|
142
72
|
|
|
143
|
-
|
|
144
|
-
|
|
73
|
+
<section id="synopsis">
|
|
74
|
+
<h2>SYNOPSIS</h2>
|
|
145
75
|
|
|
146
|
-
|
|
147
|
-
color: red }
|
|
76
|
+
<p>timequiz [options]</p>
|
|
148
77
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
78
|
+
<p>Run timequiz without any options to begin a quiz using the
|
|
79
|
+
default set of historical events—the provided collection is
|
|
80
|
+
modest in size.</p>
|
|
81
|
+
</section>
|
|
152
82
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
font-weight: bold }
|
|
156
|
-
|
|
157
|
-
div.topic {
|
|
158
|
-
margin: 2em }
|
|
159
|
-
|
|
160
|
-
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
161
|
-
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
162
|
-
margin-top: 0.4em }
|
|
163
|
-
|
|
164
|
-
h1.title {
|
|
165
|
-
text-align: center }
|
|
83
|
+
<section id="description">
|
|
84
|
+
<h2>DESCRIPTION</h2>
|
|
166
85
|
|
|
167
|
-
|
|
168
|
-
|
|
86
|
+
<p>The game presents a limited number of historical events
|
|
87
|
+
(currently three) in random order. Your task is to correctly
|
|
88
|
+
arrange them chronologically. In each subsequent round, a
|
|
89
|
+
single new event appears—you must place it in the correct
|
|
90
|
+
position relative to the previously ordered events (either
|
|
91
|
+
before one of the listed events or later).</p>
|
|
169
92
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
clear: left ;
|
|
175
|
-
float: left ;
|
|
176
|
-
margin-right: 1em }
|
|
177
|
-
|
|
178
|
-
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
179
|
-
clear: right ;
|
|
180
|
-
float: right ;
|
|
181
|
-
margin-left: 1em }
|
|
182
|
-
|
|
183
|
-
img.align-center, .figure.align-center, object.align-center {
|
|
184
|
-
display: block;
|
|
185
|
-
margin-left: auto;
|
|
186
|
-
margin-right: auto;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
table.align-center {
|
|
190
|
-
margin-left: auto;
|
|
191
|
-
margin-right: auto;
|
|
192
|
-
}
|
|
93
|
+
<p>After every round—including the first—your performance is
|
|
94
|
+
assessed. You may then choose to proceed with another event
|
|
95
|
+
or review the brief description of any event already in the
|
|
96
|
+
sequence.</p>
|
|
193
97
|
|
|
194
|
-
|
|
195
|
-
|
|
98
|
+
<p>The game continues until you press q to quit or until the
|
|
99
|
+
maximum of 15 events have been played.</p>
|
|
196
100
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
text-align: center }
|
|
101
|
+
<section id="you-dont-need-to-know-every-date">
|
|
102
|
+
<h3>YOU DON’T NEED TO KNOW EVERY DATE</h3>
|
|
200
103
|
|
|
201
|
-
|
|
202
|
-
|
|
104
|
+
<p>Winning often does not require exact historical
|
|
105
|
+
knowledge. Instead, logical reasoning or educated
|
|
106
|
+
guesses—eliminating events that are clearly too early or
|
|
107
|
+
too late—usually suffices. Reading the event descriptions
|
|
108
|
+
may also help you situate other events in historical
|
|
109
|
+
context later on.</p>
|
|
110
|
+
</section>
|
|
111
|
+
</section>
|
|
203
112
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
text-align: inherit }
|
|
113
|
+
<section id="options-not-needed-to-play">
|
|
114
|
+
<h2>OPTIONS (not needed to play)</h2>
|
|
207
115
|
|
|
208
|
-
|
|
209
|
-
/* text-align: left } */
|
|
116
|
+
<p><strong>-a, --add</strong> Add a new event to the game</p>
|
|
210
117
|
|
|
211
|
-
|
|
212
|
-
|
|
118
|
+
<p><strong>-e, --event</strong> [EVENT] Provide a name of the
|
|
119
|
+
new event</p>
|
|
213
120
|
|
|
214
|
-
|
|
215
|
-
|
|
121
|
+
<p><strong>-y, --year</strong> [YEAR] Specify the year of the
|
|
122
|
+
new event</p>
|
|
216
123
|
|
|
217
|
-
|
|
218
|
-
|
|
124
|
+
<p><strong>-b, --background</strong> [INFO] Supply background
|
|
125
|
+
information for the new event</p>
|
|
219
126
|
|
|
220
|
-
|
|
221
|
-
|
|
127
|
+
<p><strong>-f, --file</strong> [FILE] Specify the file for
|
|
128
|
+
reading/writing events</p>
|
|
222
129
|
|
|
223
|
-
|
|
224
|
-
|
|
130
|
+
<p><strong>-d, --debug</strong> Enable verbose debug
|
|
131
|
+
output</p>
|
|
225
132
|
|
|
226
|
-
|
|
227
|
-
list-style: lower-alpha }
|
|
133
|
+
<p><strong>-v, --version</strong> Display program version</p>
|
|
228
134
|
|
|
229
|
-
|
|
230
|
-
list-style: upper-alpha }
|
|
135
|
+
<p><strong>-h, --help</strong> Show help message</p>
|
|
231
136
|
|
|
232
|
-
|
|
233
|
-
|
|
137
|
+
<section id="the-options-in-detail">
|
|
138
|
+
<h3>The Options in detail:</h3>
|
|
234
139
|
|
|
235
|
-
|
|
236
|
-
|
|
140
|
+
<dl class="simple">
|
|
141
|
+
<dt>-a --add</dt>
|
|
237
142
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
143
|
+
<dd>
|
|
144
|
+
<p>Requires -e, -y, and -f. This redundancy may be
|
|
145
|
+
removed in future versions.</p>
|
|
146
|
+
</dd>
|
|
241
147
|
|
|
242
|
-
|
|
243
|
-
font-style: italic }
|
|
148
|
+
<dt>-e --event [EVENT]</dt>
|
|
244
149
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
150
|
+
<dd>
|
|
151
|
+
<p>The name of the event to add. Requires --add,
|
|
152
|
+
--year, and --file. Use quotes for multi-word events,
|
|
153
|
+
e.g., --event "Some Guy Was Born and Something
|
|
154
|
+
Broke".</p>
|
|
155
|
+
</dd>
|
|
156
|
+
|
|
157
|
+
<dt>-y --year [YEAR]</dt>
|
|
158
|
+
|
|
159
|
+
<dd>
|
|
160
|
+
<p>The year of the event, e.g., -y 1244.</p>
|
|
161
|
+
</dd>
|
|
248
162
|
|
|
249
|
-
|
|
250
|
-
white-space: nowrap }
|
|
251
|
-
|
|
252
|
-
p.rubric {
|
|
253
|
-
font-weight: bold ;
|
|
254
|
-
font-size: larger ;
|
|
255
|
-
color: maroon ;
|
|
256
|
-
text-align: center }
|
|
257
|
-
|
|
258
|
-
p.sidebar-title {
|
|
259
|
-
font-family: sans-serif ;
|
|
260
|
-
font-weight: bold ;
|
|
261
|
-
font-size: larger }
|
|
262
|
-
|
|
263
|
-
p.sidebar-subtitle {
|
|
264
|
-
font-family: sans-serif ;
|
|
265
|
-
font-weight: bold }
|
|
266
|
-
|
|
267
|
-
p.topic-title {
|
|
268
|
-
font-weight: bold }
|
|
269
|
-
|
|
270
|
-
pre.address {
|
|
271
|
-
margin-bottom: 0 ;
|
|
272
|
-
margin-top: 0 ;
|
|
273
|
-
font: inherit }
|
|
274
|
-
|
|
275
|
-
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
276
|
-
margin-left: 2em ;
|
|
277
|
-
margin-right: 2em }
|
|
278
|
-
|
|
279
|
-
pre.code .ln { color: gray; } /* line numbers */
|
|
280
|
-
pre.code, code { background-color: #eeeeee }
|
|
281
|
-
pre.code .comment, code .comment { color: #5C6576 }
|
|
282
|
-
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
283
|
-
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
284
|
-
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
285
|
-
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
286
|
-
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
163
|
+
<dt>-b --background [INFO]</dt>
|
|
287
164
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
165
|
+
<dd>
|
|
166
|
+
<p>Optional context to help with the quiz—use
|
|
167
|
+
sparingly. For example: -b "The phenomenon was of no
|
|
168
|
+
significance whatsoever".</p>
|
|
169
|
+
</dd>
|
|
291
170
|
|
|
292
|
-
|
|
293
|
-
font-family: sans-serif ;
|
|
294
|
-
font-weight: bold }
|
|
171
|
+
<dt>-f --file [FILE]</dt>
|
|
295
172
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
173
|
+
<dd>
|
|
174
|
+
<p>Path to the events file used for quizzes or for
|
|
175
|
+
adding new events. If the file does not exist, it is
|
|
176
|
+
created with some sample events. It must be readable
|
|
177
|
+
for quizzes and writable for additions.</p>
|
|
178
|
+
</dd>
|
|
179
|
+
|
|
180
|
+
<dt>-d --debug</dt>
|
|
181
|
+
|
|
182
|
+
<dd>
|
|
183
|
+
<p>Enables verbose debugging output. Mainly useful for
|
|
184
|
+
developers.</p>
|
|
185
|
+
</dd>
|
|
186
|
+
|
|
187
|
+
<dt>-v --version</dt>
|
|
188
|
+
|
|
189
|
+
<dd>
|
|
190
|
+
<p>Display the current version of the program.</p>
|
|
191
|
+
</dd>
|
|
307
192
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<p>
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
<
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
<
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
</
|
|
395
|
-
|
|
396
|
-
<
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
<
|
|
403
|
-
<
|
|
404
|
-
|
|
405
|
-
<
|
|
406
|
-
<
|
|
407
|
-
|
|
408
|
-
<
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
<
|
|
413
|
-
<
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
<dt
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
<
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
<dt
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
<
|
|
445
|
-
<
|
|
446
|
-
</
|
|
447
|
-
|
|
448
|
-
<tr><td><p class="first">Put the following events into the right chronological order (e.g.: 2 3 1).</p>
|
|
449
|
-
<ol class="arabic simple">
|
|
450
|
-
<li>The Roman emperor Diocletian devides the empire in two</li>
|
|
451
|
-
<li>End of the "War of the mercenaries"</li>
|
|
452
|
-
<li>Destruction of Nimrod and Ninive by the Medians and Neo-Babylonians</li>
|
|
453
|
-
</ol>
|
|
454
|
-
<p class="last">Available: 1, 2, 3)</p>
|
|
455
|
-
</td>
|
|
456
|
-
</tr>
|
|
457
|
-
</tbody>
|
|
458
|
-
</table>
|
|
459
|
-
<p>You type in the three numbers in the order that you consider chronologically
|
|
460
|
-
correct, like "321" (you do not have to push return after each number). The
|
|
461
|
-
game will respond by showing you the correct order of events with the
|
|
462
|
-
corresponding years and an evaluation of your input. You are also prompted to
|
|
463
|
-
decide if you want to play with a new arbitrary event or first be shown some
|
|
464
|
-
information about the listed events:</p>
|
|
465
|
-
<table border="1" class="docutils">
|
|
466
|
-
<colgroup>
|
|
467
|
-
<col width="100%" />
|
|
468
|
-
</colgroup>
|
|
469
|
-
<tbody valign="top">
|
|
470
|
-
<tr><td>Enter number for more information about an event, 'a' to play with one new, random event, 'q' to quit.</td>
|
|
471
|
-
</tr>
|
|
472
|
-
</tbody>
|
|
473
|
-
</table>
|
|
474
|
-
<p>If you push 'a', a new event is shown:</p>
|
|
475
|
-
<table border="1" class="docutils">
|
|
476
|
-
<colgroup>
|
|
477
|
-
<col width="100%" />
|
|
478
|
-
</colgroup>
|
|
479
|
-
<tbody valign="top">
|
|
480
|
-
<tr><td><p class="first">Indicate the event from the previous list, which precedes the following, or '0' (zero) to put it in front:</p>
|
|
481
|
-
<p class="last">The Italian painter Lorenzo Lotto dies.</p>
|
|
482
|
-
</td>
|
|
483
|
-
</tr>
|
|
484
|
-
</tbody>
|
|
485
|
-
</table>
|
|
486
|
-
<p>You can now decide, which of the three previous events precedes the death of
|
|
487
|
-
the Italian painter and either put in the (current) number of that previous
|
|
488
|
-
event or the number 0 (zero) if you consider that Lorenzo Lotto died well
|
|
489
|
-
before any of the other events (which would, of course, be false in the
|
|
490
|
-
example). You have to push the return-button after your input, as it can
|
|
491
|
-
contain an arbitrary number of ciphers, later in the game.</p>
|
|
492
|
-
</div>
|
|
493
|
-
<div class="section" id="other-information">
|
|
494
|
-
<h1>Other Information</h1>
|
|
495
|
-
<dl class="docutils">
|
|
496
|
-
<dt>Development and source code</dt>
|
|
497
|
-
<dd>timequiz has been written in Ruby. As Ruby is an interpreted programming
|
|
498
|
-
language, the executable file and all those that it may refer to at one point
|
|
499
|
-
in time, are themselves the source-files of the current program-version. You
|
|
500
|
-
can open them in any text-editor to scrutinize the source-code. If you have
|
|
501
|
-
received the program as a Ruby-gem, you can also decompress a copy of the
|
|
502
|
-
gem-file with <em>tar -x</em>, then <em>tar -xzf</em>.</dd>
|
|
503
|
-
<dt>Bugs</dt>
|
|
504
|
-
<dd>At one time during the game, the list of already known events is incorrectly
|
|
505
|
-
wrapped and continues to be.</dd>
|
|
506
|
-
<dt>License</dt>
|
|
507
|
-
<dd>timequiz is distributed under the conditions of the GNU General Public
|
|
508
|
-
License, version 3.</dd>
|
|
509
|
-
<dt>Author</dt>
|
|
510
|
-
<dd>timequiz has been developed by Michael Uplawski
|
|
511
|
-
<<a class="reference external" href="mailto:michael.uplawski@uplawski.eu">michael.uplawski@uplawski.eu</a>></dd>
|
|
512
|
-
</dl>
|
|
513
|
-
</div>
|
|
514
|
-
</div>
|
|
193
|
+
<dt>-h --help</dt>
|
|
194
|
+
|
|
195
|
+
<dd>
|
|
196
|
+
<p>Show this list of options and usage
|
|
197
|
+
instructions.</p>
|
|
198
|
+
</dd>
|
|
199
|
+
</dl>
|
|
200
|
+
</section>
|
|
201
|
+
</section>
|
|
202
|
+
|
|
203
|
+
<section id="game-example">
|
|
204
|
+
<h2>GAME EXAMPLE</h2>
|
|
205
|
+
|
|
206
|
+
<p>Launching timequiz with no options displays three random
|
|
207
|
+
historical events, prompting:</p>
|
|
208
|
+
|
|
209
|
+
<table>
|
|
210
|
+
<tbody>
|
|
211
|
+
<tr>
|
|
212
|
+
<td>
|
|
213
|
+
<p>Put the following events into the right
|
|
214
|
+
chronological order (e.g.: 2 3 1).</p>
|
|
215
|
+
|
|
216
|
+
<ol class="arabic simple">
|
|
217
|
+
<li>
|
|
218
|
+
<p>The Roman emperor Diocletian devides the
|
|
219
|
+
empire in two</p>
|
|
220
|
+
</li>
|
|
221
|
+
|
|
222
|
+
<li>
|
|
223
|
+
<p>End of the "War of the mercenaries"</p>
|
|
224
|
+
</li>
|
|
225
|
+
|
|
226
|
+
<li>
|
|
227
|
+
<p>Destruction of Nimrod and Ninive by the
|
|
228
|
+
Medians and Neo-Babylonians</p>
|
|
229
|
+
</li>
|
|
230
|
+
</ol>
|
|
231
|
+
|
|
232
|
+
<p>Available: 1, 2, 3)</p>
|
|
233
|
+
</td>
|
|
234
|
+
</tr>
|
|
235
|
+
</tbody>
|
|
236
|
+
</table>
|
|
237
|
+
|
|
238
|
+
<p>Enter your sequence (e.g., 321) without needing to press
|
|
239
|
+
Enter after each number. The game then shows the correct
|
|
240
|
+
order with years and evaluates your input. You’ll be asked if
|
|
241
|
+
you wish to continue with a new event or view more info on
|
|
242
|
+
the listed events.</p>
|
|
243
|
+
|
|
244
|
+
<table>
|
|
245
|
+
<tbody>
|
|
246
|
+
<tr>
|
|
247
|
+
<td>
|
|
248
|
+
<p>Enter number for more information about an event,
|
|
249
|
+
'a' to play with one new, random event, 'q' to
|
|
250
|
+
quit.</p>
|
|
251
|
+
</td>
|
|
252
|
+
</tr>
|
|
253
|
+
</tbody>
|
|
254
|
+
</table>
|
|
255
|
+
|
|
256
|
+
<p>To continue:</p>
|
|
257
|
+
|
|
258
|
+
<p>Press a number to view an event’s details,</p>
|
|
259
|
+
|
|
260
|
+
<p>a to add a new random event, or</p>
|
|
261
|
+
|
|
262
|
+
<p>q to quit.</p>
|
|
263
|
+
|
|
264
|
+
<p>If you choose a, here’s how the next prompt may
|
|
265
|
+
appear:</p>
|
|
266
|
+
|
|
267
|
+
<table>
|
|
268
|
+
<tbody>
|
|
269
|
+
<tr>
|
|
270
|
+
<td>
|
|
271
|
+
<p>Indicate the event from the previous list, which
|
|
272
|
+
precedes the following, or '0' (zero) to put it in
|
|
273
|
+
front:</p>
|
|
274
|
+
|
|
275
|
+
<p>The Italian painter Lorenzo Lotto dies.</p>
|
|
276
|
+
</td>
|
|
277
|
+
</tr>
|
|
278
|
+
</tbody>
|
|
279
|
+
</table>
|
|
280
|
+
|
|
281
|
+
<p>You must then enter the corresponding number or 0 if you
|
|
282
|
+
believe that the event occurred before all listed events
|
|
283
|
+
(which, in this case, would be historically inaccurate).
|
|
284
|
+
Press Enter to submit your answer.</p>
|
|
285
|
+
</section>
|
|
286
|
+
|
|
287
|
+
<section id="additional-information">
|
|
288
|
+
<h2>ADDITIONAL INFORMATION</h2>
|
|
289
|
+
|
|
290
|
+
<dl class="simple">
|
|
291
|
+
<dt>Development & Source Code</dt>
|
|
292
|
+
|
|
293
|
+
<dd>
|
|
294
|
+
<p>timequiz is written in Ruby. As it's interpreted, the
|
|
295
|
+
executable is essentially the source code—you can open it
|
|
296
|
+
in any text editor. If installed from a Ruby gem, you can
|
|
297
|
+
extract it using <span class="docutils literal">tar
|
|
298
|
+
<span class="pre">-x</span></span>, then <span class=
|
|
299
|
+
"docutils literal">tar <span class=
|
|
300
|
+
"pre">-xzf</span></span>.</p>
|
|
301
|
+
</dd>
|
|
302
|
+
|
|
303
|
+
<dt>Known Bug</dt>
|
|
304
|
+
|
|
305
|
+
<dd>
|
|
306
|
+
<p>At times, the list of events may wrap incorrectly in
|
|
307
|
+
the display.</p>
|
|
308
|
+
</dd>
|
|
309
|
+
|
|
310
|
+
<dt>License</dt>
|
|
311
|
+
|
|
312
|
+
<dd>
|
|
313
|
+
<p>Timequiz is distributed under the WTFPL-2.0 or later
|
|
314
|
+
License. For more details, visit <a class=
|
|
315
|
+
"reference external" href=
|
|
316
|
+
"http://www.wtfpl.net/txt/copying/">http://www.wtfpl.net/txt/copying/</a></p>
|
|
317
|
+
</dd>
|
|
318
|
+
|
|
319
|
+
<dt>Author</dt>
|
|
320
|
+
|
|
321
|
+
<dd>
|
|
322
|
+
<p>Developed by Michael Uplawski <<a class=
|
|
323
|
+
"reference external" href=
|
|
324
|
+
"mailto:michael.uplawski@uplawski.eu">michael.uplawski@uplawski.eu</a>></p>
|
|
325
|
+
</dd>
|
|
326
|
+
</dl>
|
|
327
|
+
</section>
|
|
328
|
+
|
|
329
|
+
<section id="section-1">
|
|
330
|
+
<h2>Ω</h2>
|
|
331
|
+
</section>
|
|
332
|
+
</main>
|
|
515
333
|
</body>
|
|
516
334
|
</html>
|
data/doc/man/timequiz.6.gz
CHANGED
|
Binary file
|
data/doc/pdf/timequiz.pdf
CHANGED
|
Binary file
|
data/doc/rst/timequiz.rst
CHANGED
|
@@ -2,100 +2,94 @@
|
|
|
2
2
|
TIMEQUIZ
|
|
3
3
|
=======================
|
|
4
4
|
----------------------------------------
|
|
5
|
-
|
|
5
|
+
Play a history-quiz game
|
|
6
6
|
----------------------------------------
|
|
7
7
|
|
|
8
8
|
SYNOPSIS
|
|
9
9
|
=======================
|
|
10
10
|
timequiz [options]
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
Run timequiz without any options to begin a quiz using the default set of
|
|
13
|
+
historical events—the provided collection is modest in size.
|
|
14
14
|
|
|
15
15
|
DESCRIPTION
|
|
16
16
|
=======================
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
|
|
18
|
+
The game presents a limited number of historical events (currently three) in
|
|
19
|
+
random order. Your task is to correctly arrange them chronologically. In each
|
|
20
|
+
subsequent round, a single new event appears—you must place it in the correct
|
|
21
|
+
position relative to the previously ordered events (either before one of the
|
|
22
|
+
listed events or later).
|
|
23
|
+
|
|
24
|
+
After every round—including the first—your performance is assessed. You may
|
|
25
|
+
then choose to proceed with another event or review the brief description of
|
|
26
|
+
any event already in the sequence.
|
|
27
|
+
|
|
28
|
+
The game continues until you press q to quit or until the maximum of 15 events
|
|
29
|
+
have been played.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
YOU DON’T NEED TO KNOW EVERY DATE
|
|
33
|
+
---------------------------------
|
|
34
|
+
|
|
35
|
+
Winning often does not require exact historical knowledge. Instead, logical
|
|
36
|
+
reasoning or educated guesses—eliminating events that are clearly too early or
|
|
37
|
+
too late—usually suffices. Reading the event descriptions may also help you
|
|
38
|
+
situate other events in historical context later on.
|
|
39
|
+
|
|
40
|
+
OPTIONS (not needed to play)
|
|
39
41
|
=====================================
|
|
40
42
|
|
|
41
43
|
**-a, --add** Add a new event to the game
|
|
42
44
|
|
|
43
|
-
**-e, --event** [EVENT]
|
|
45
|
+
**-e, --event** [EVENT] Provide a name of the new event
|
|
44
46
|
|
|
45
|
-
**-y, --year** [YEAR]
|
|
47
|
+
**-y, --year** [YEAR] Specify the year of the new event
|
|
46
48
|
|
|
47
|
-
**-b, --background** [INFO]
|
|
49
|
+
**-b, --background** [INFO] Supply background information for the new event
|
|
48
50
|
|
|
49
|
-
**-f, --file** [FILE]
|
|
51
|
+
**-f, --file** [FILE] Specify the file for reading/writing events
|
|
50
52
|
|
|
51
|
-
**-d, --debug**
|
|
53
|
+
**-d, --debug** Enable verbose debug output
|
|
52
54
|
|
|
53
|
-
**-v, --version**
|
|
55
|
+
**-v, --version** Display program version
|
|
54
56
|
|
|
55
|
-
**-h, --help** Show
|
|
57
|
+
**-h, --help** Show help message
|
|
56
58
|
|
|
57
59
|
The Options in detail:
|
|
58
60
|
----------------------
|
|
59
61
|
-a --add
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-f --file
|
|
78
|
-
Name the “events-file” which will be used for either creating the quizzes
|
|
79
|
-
randomly or adding events to an existing list of events. The file must be
|
|
80
|
-
readable to serve for a quiz and writable to accept new events. If it does
|
|
81
|
-
not exist, it is created and some exemplary events are included on top.
|
|
82
|
-
Example: --file ~/my_history_quiz
|
|
62
|
+
Requires -e, -y, and -f. This redundancy may be removed in future versions.
|
|
63
|
+
|
|
64
|
+
-e --event [EVENT]
|
|
65
|
+
The name of the event to add. Requires --add, --year, and --file. Use quotes
|
|
66
|
+
for multi-word events, e.g., --event "Some Guy Was Born and Something Broke".
|
|
67
|
+
|
|
68
|
+
-y --year [YEAR]
|
|
69
|
+
The year of the event, e.g., -y 1244.
|
|
70
|
+
|
|
71
|
+
-b --background [INFO]
|
|
72
|
+
Optional context to help with the quiz—use sparingly. For example: -b "The
|
|
73
|
+
phenomenon was of no significance whatsoever".
|
|
74
|
+
|
|
75
|
+
-f --file [FILE]
|
|
76
|
+
Path to the events file used for quizzes or for adding new events. If the file
|
|
77
|
+
does not exist, it is created with some sample events. It must be readable for
|
|
78
|
+
quizzes and writable for additions.
|
|
83
79
|
|
|
84
80
|
-d --debug
|
|
85
|
-
|
|
86
|
-
in the program code. Probably useless.
|
|
81
|
+
Enables verbose debugging output. Mainly useful for developers.
|
|
87
82
|
|
|
88
83
|
-v --version
|
|
89
|
-
|
|
84
|
+
Display the current version of the program.
|
|
90
85
|
|
|
91
86
|
-h --help
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
Show this list of options and usage instructions.
|
|
94
88
|
|
|
95
89
|
GAME EXAMPLE
|
|
96
90
|
=======================
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
Launching timequiz with no options displays three random historical events,
|
|
92
|
+
prompting:
|
|
99
93
|
|
|
100
94
|
+---------------------------------------------------------------------------+
|
|
101
95
|
|Put the following events into the right chronological order (e.g.: 2 3 1). |
|
|
@@ -107,18 +101,24 @@ three arbitrary, historical events, like in the following screen:
|
|
|
107
101
|
|Available: 1, 2, 3) |
|
|
108
102
|
+---------------------------------------------------------------------------+
|
|
109
103
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
decide if you want to play with a new arbitrary event or first be shown some
|
|
115
|
-
information about the listed events:
|
|
104
|
+
Enter your sequence (e.g., 321) without needing to press Enter after each
|
|
105
|
+
number. The game then shows the correct order with years and evaluates your
|
|
106
|
+
input. You’ll be asked if you wish to continue with a new event or view more
|
|
107
|
+
info on the listed events.
|
|
116
108
|
|
|
117
109
|
+------------------------------------------------------------------------------------------------------+
|
|
118
110
|
|Enter number for more information about an event, 'a' to play with one new, random event, 'q' to quit.|
|
|
119
111
|
+------------------------------------------------------------------------------------------------------+
|
|
120
112
|
|
|
121
|
-
|
|
113
|
+
To continue:
|
|
114
|
+
|
|
115
|
+
Press a number to view an event’s details,
|
|
116
|
+
|
|
117
|
+
a to add a new random event, or
|
|
118
|
+
|
|
119
|
+
q to quit.
|
|
120
|
+
|
|
121
|
+
If you choose a, here’s how the next prompt may appear:
|
|
122
122
|
|
|
123
123
|
+----------------------------------------------------------------------------------------------------------+
|
|
124
124
|
|Indicate the event from the previous list, which precedes the following, or '0' (zero) to put it in front:|
|
|
@@ -126,32 +126,26 @@ If you push 'a', a new event is shown:
|
|
|
126
126
|
|The Italian painter Lorenzo Lotto dies. |
|
|
127
127
|
+----------------------------------------------------------------------------------------------------------+
|
|
128
128
|
|
|
129
|
-
You
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
can open them in any text-editor to scrutinize the source-code. If you have
|
|
143
|
-
received the program as a Ruby-gem, you can also decompress a copy of the
|
|
144
|
-
gem-file with *tar -x*, then *tar -xzf*.
|
|
145
|
-
|
|
146
|
-
Bugs
|
|
147
|
-
At one time during the game, the list of already known events is incorrectly
|
|
148
|
-
wrapped and continues to be.
|
|
129
|
+
You must then enter the corresponding number or 0 if you believe that the event
|
|
130
|
+
occurred before all listed events (which, in this case, would be historically
|
|
131
|
+
inaccurate). Press Enter to submit your answer.
|
|
132
|
+
|
|
133
|
+
ADDITIONAL INFORMATION
|
|
134
|
+
======================
|
|
135
|
+
Development & Source Code
|
|
136
|
+
timequiz is written in Ruby. As it's interpreted, the executable is
|
|
137
|
+
essentially the source code—you can open it in any text editor. If installed
|
|
138
|
+
from a Ruby gem, you can extract it using ``tar -x``, then ``tar -xzf``.
|
|
139
|
+
|
|
140
|
+
Known Bug
|
|
141
|
+
At times, the list of events may wrap incorrectly in the display.
|
|
149
142
|
|
|
150
143
|
License
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
Timequiz is distributed under the WTFPL-2.0 or later License.
|
|
145
|
+
For more details, visit http://www.wtfpl.net/txt/copying/
|
|
153
146
|
|
|
154
147
|
Author
|
|
155
|
-
|
|
156
|
-
<michael.uplawski@uplawski.eu>
|
|
148
|
+
Developed by Michael Uplawski <michael.uplawski@uplawski.eu>
|
|
157
149
|
|
|
150
|
+
Ω
|
|
151
|
+
============
|
data/lib/adder.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#encoding: UTF-8
|
|
3
3
|
=begin
|
|
4
4
|
/***************************************************************************
|
|
5
|
-
* ©2017-
|
|
5
|
+
* ©2017-2025, Michael Uplawski <michael.uplawski@uplawski.eu> *
|
|
6
6
|
* *
|
|
7
7
|
* This program is free software; you can redistribute it and/or modify *
|
|
8
8
|
* it under the terms of the WTFPL 2.0 or later, see *
|
|
@@ -22,13 +22,16 @@ require_relative 'basic_logging'
|
|
|
22
22
|
class Adder
|
|
23
23
|
#@@events_file = File.dirname(__FILE__) << File::Separator << 'events.rb'
|
|
24
24
|
#@@events_backup = File.dirname(__FILE__) << File::Separator << 'bak_events.rb'
|
|
25
|
-
include BasicLogging
|
|
26
25
|
|
|
26
|
+
self::extend BasicLogging
|
|
27
|
+
|
|
27
28
|
def self::add(options)
|
|
28
29
|
debug('options are ' << options.to_s)
|
|
29
30
|
if options.file
|
|
30
31
|
@@events_file = options.file
|
|
31
|
-
|
|
32
|
+
if(File::exist?(@@events_file) )
|
|
33
|
+
@@events_backup = File.dirname(@@events_file) << File::Separator << 'bak_' << File.basename(@@events_file)
|
|
34
|
+
end
|
|
32
35
|
else
|
|
33
36
|
error('To add events, you must name a file on the command-line. Aborting')
|
|
34
37
|
exit false
|
data/lib/console.rb
CHANGED
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
require_relative 'extstring'
|
|
17
17
|
require_relative 'user_input'
|
|
18
18
|
require_relative 'constants'
|
|
19
|
+
require_relative 'basic_logging'
|
|
19
20
|
|
|
20
21
|
# Functions which create a user-interface in the terminal
|
|
21
22
|
module Console
|
|
23
|
+
include BasicLogging
|
|
24
|
+
|
|
22
25
|
# Some definitions which may change one day, become configurable one day,
|
|
23
26
|
# need to be accessed (one day) from somewhere else or not.
|
|
24
|
-
|
|
25
27
|
@@won_text = %q"__ __ _ __ __
|
|
26
28
|
\ \/ /___ __ __ | | / /___ ____ / /
|
|
27
29
|
\ / __ \/ / / / | | /| / / __ \/ __ \ / /
|
|
@@ -41,7 +43,7 @@ module Console
|
|
|
41
43
|
def start_game
|
|
42
44
|
available = $events
|
|
43
45
|
clear
|
|
44
|
-
puts bold("\nPut the following events into the
|
|
46
|
+
puts bold("\nPut the following events into the correct chronological order (e.g.: 2 3 1).")
|
|
45
47
|
@m_events = Array.new
|
|
46
48
|
out = ''
|
|
47
49
|
$num_events.times do |i|
|
|
@@ -80,6 +82,7 @@ module Console
|
|
|
80
82
|
end
|
|
81
83
|
if('a' == ui)
|
|
82
84
|
ev = new_event
|
|
85
|
+
# all known events have been handled.
|
|
83
86
|
if ev == :all_events_done
|
|
84
87
|
score(@@points, true)
|
|
85
88
|
exit true
|
|
@@ -112,7 +115,7 @@ module Console
|
|
|
112
115
|
else
|
|
113
116
|
lose
|
|
114
117
|
end
|
|
115
|
-
score(@@points)
|
|
118
|
+
score(@@points, @m_events.length == $MAX_NUM_EVENTS)
|
|
116
119
|
else
|
|
117
120
|
detail( a2i(ui) )
|
|
118
121
|
end
|
|
@@ -166,6 +169,7 @@ module Console
|
|
|
166
169
|
|
|
167
170
|
def score(pts, all_done = false)
|
|
168
171
|
intro = (all_done ? 'Final score' : 'Current score')
|
|
172
|
+
debug('all_done? ' << all_done.to_s)
|
|
169
173
|
puts ' (' << intro << ': %i %s)' %[pts, (pts == 1 ? 'point' : 'points')]
|
|
170
174
|
end
|
|
171
175
|
|
|
@@ -178,7 +182,7 @@ module Console
|
|
|
178
182
|
end
|
|
179
183
|
|
|
180
184
|
def show_correct_order
|
|
181
|
-
cmt = "\tThe
|
|
185
|
+
cmt = "\tThe correct order is:\n" << @m_events.collect {|ev| (@m_events.index(ev) + 1).to_s << ') ' << ev.title << ' (' << ev.year.to_s << ')'}.join("\n").box()
|
|
182
186
|
wait(@@wait_sequence, 1, cmt)
|
|
183
187
|
end
|
|
184
188
|
|
|
@@ -205,7 +209,7 @@ module Console
|
|
|
205
209
|
def compare_order(response)
|
|
206
210
|
puts "\n... You say: " << bold(response.join(', '))
|
|
207
211
|
devents = @m_events.dup.sort {|f, s| f.year <=> s.year }
|
|
208
|
-
cmt = "\tThe
|
|
212
|
+
cmt = "\tThe correct order is:\n" << devents.collect {|ev| ev.disp_index.to_s << ') ' << ev.year.to_s }.join("\n").box()
|
|
209
213
|
wait(@@wait_sequence, 1, cmt)
|
|
210
214
|
end
|
|
211
215
|
|
data/lib/events.rb
CHANGED
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
=end
|
|
16
16
|
|
|
17
17
|
# All events known.
|
|
18
|
+
$events << ['Howard Hughes founds his own aircraft company', 1932,'Hughes was an American manufacturer, aviator, and motion-picture producer and director who acquired enormous wealth and celebrity from his various ventures but was perhaps better known for his eccentricities, especially his reclusiveness (britannica.com).' ]
|
|
19
|
+
$events << ['Destruction of the German town Dresden', 1945,'The bombing on February 1945 caused a firestorm which left the town ablaze for weeks and killed about 35000 people although the precise number will probably never be established.' ]
|
|
20
|
+
$events << ['The aviator Charles Lindbergh dies', 1974,'Charles Lindbergh was the first aviator to complete a solo transatlantic flight in May 1927.' ]
|
|
21
|
+
$events << ['The antropologist Claude Lévi-Strauss is born', 1908,'Lévi-Strauss argued that the "savage" mind had the same structures as the "civilized" mind and that human characteristics are the same everywhere. He received numerous honors from universities and institutions throughout the world.' ]
|
|
22
|
+
$events << ['Napoleon Bonaparte dies', 1821,'Napoleon Bonaparte died at 5.49pm on 5 May 1821, at Longwood on the island of Saint Helena. An autopsy was carried out on 6 May; a preliminary cast for a death mask was taken on 7 May; and on 9 May the Emperor was buried, in the presence of French and English witnesses. Yet since the nineteenth century, mystery and myths have shrouded Napoleon’s death, and the events and people that surrounded it (napoleon.org).' ]
|
|
18
23
|
$events << ['First hydrogen bomb', 1952,'The first test bomb was called the Ivy Mike device. It was not a deliverable bomb- it weighed 82 tons and used an Atomic bomb to trigger the hydrogen explosion. The bomb was set off on Eniwetok atoll on November 1st. The weapon was 10.4 megatons- 1,000 times stronger than the bomb that destroyed Hiroshima. It was twice the power of all the bombs dropped during World War II.' ]
|
|
19
24
|
$events << ['Publication of the theory of Special Relativity by Albert Einstein', 1905, "Einstein postulated in his study that the speed of light is immutable, constant, and independent of the observer's motion. Therefore, except the constant speed of light, everything is relative, including time, distance, and mass."]
|
|
20
25
|
$events << ['The mass of the Earth is estimated for the first time.', 1775, 'Nevil Maskelyne’s experiment on the Scottish mountain Schiehallion set out to derive the mean density of the Earth, from astronomical observations of the deflection of the vertical and calculation of the mountain’s relative gravitational attraction. His results were later amended by the works of Charles Hutton.']
|
data/lib/version.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
=begin
|
|
4
4
|
/***************************************************************************
|
|
5
|
-
* ©2017-
|
|
5
|
+
* ©2017-2025, Michael Uplawski <michael.uplawski@uplawski.eu> *
|
|
6
6
|
* *
|
|
7
7
|
* This program is free software; you can redistribute it and/or modify *
|
|
8
8
|
* it under the terms of the WTFPL 2.0 or later, see *
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
***************************************************************************/
|
|
16
16
|
=end
|
|
17
17
|
|
|
18
|
-
VERSION = '0.
|
|
19
|
-
SUMMARY = '
|
|
18
|
+
VERSION = '0.3'
|
|
19
|
+
SUMMARY = 'Adder: logging and file-operations corrected'
|
|
20
20
|
AUTHOR = 'Michael Uplawski'
|
|
21
21
|
AUTHOR_MAIL = '<michael.uplawski@uplawski.eu>'
|
|
22
22
|
YEARS = 2017 - 2025
|
data/timequiz.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
|
16
16
|
s.license = 'Nonstandard'
|
|
17
17
|
s.required_ruby_version = '>= 2.7'
|
|
18
18
|
s.metadata = {
|
|
19
|
-
"homepage_uri" => 'https://www.uplawski.eu/software/timequiz/
|
|
19
|
+
"homepage_uri" => 'https://www.uplawski.eu/software/timequiz/',
|
|
20
20
|
"documentation_uri" => 'https://www.uplawski.eu/software/timequiz/man_timequiz.html'
|
|
21
21
|
}
|
|
22
22
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: timequiz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Uplawski
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-08
|
|
10
|
+
date: 2025-11-08 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: Play a history game
|
|
13
13
|
email: michael.uplawski@uplawski.eu
|
|
@@ -41,7 +41,7 @@ files:
|
|
|
41
41
|
licenses:
|
|
42
42
|
- Nonstandard
|
|
43
43
|
metadata:
|
|
44
|
-
homepage_uri: https://www.uplawski.eu/software/timequiz/
|
|
44
|
+
homepage_uri: https://www.uplawski.eu/software/timequiz/
|
|
45
45
|
documentation_uri: https://www.uplawski.eu/software/timequiz/man_timequiz.html
|
|
46
46
|
rdoc_options: []
|
|
47
47
|
require_paths:
|
|
@@ -59,5 +59,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
59
59
|
requirements: []
|
|
60
60
|
rubygems_version: 3.6.7
|
|
61
61
|
specification_version: 4
|
|
62
|
-
summary:
|
|
62
|
+
summary: 'Adder: logging and file-operations corrected'
|
|
63
63
|
test_files: []
|