timequiz 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cf32c95c2a8240d508dd756014c4d007f8fad25d
4
+ data.tar.gz: 6ae09086d0af2afe9d06db6777910295236db67e
5
+ SHA512:
6
+ metadata.gz: 166123609c82a502915d03474dc9f8fe4e8cb358ce1d4709db5d6d9dc295b6a96ec208b0f35d3acb8f99fd2dd8dd6111b513866a94754a2a120c554f92d3546b
7
+ data.tar.gz: 17cd0020f495adf460913f0343300fb1186ffcd489753629cd80497d022ba7f0b0a19c9e84e263604ef4390996e3bd70867a47a398b4c275f6cf2332b978ef47
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+ #encoding: UTF-8
3
+ =begin
4
+ /***************************************************************************
5
+ * ©2017-2017, Michael Uplawski <michael.uplawski@uplawski.eu> *
6
+ * *
7
+ * This program is free software; you can redistribute it and/or modify *
8
+ * it under the terms of the GNU General Public License as published by *
9
+ * the Free Software Foundation; either version 3 of the License, or *
10
+ * (at your option) any later version. *
11
+ * *
12
+ * This program is distributed in the hope that it will be useful, *
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
+ * GNU General Public License for more details. *
16
+ * *
17
+ * You should have received a copy of the GNU General Public License *
18
+ * along with this program; if not, write to the *
19
+ * Free Software Foundation, Inc., *
20
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
+ ***************************************************************************/
22
+ =end
23
+
24
+ require_relative "../lib/timequiz.rb"
25
+
26
+ Timequiz.new(ARGV)
@@ -0,0 +1,515 @@
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
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="Docutils 0.13.1: http://docutils.sourceforge.net/" />
7
+ <title>Timequiz</title>
8
+ <style type="text/css">
9
+
10
+ /*
11
+ :Author: David Goodger (goodger@python.org)
12
+ :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
13
+ :Copyright: This stylesheet has been placed in the public domain.
14
+
15
+ Default cascading style sheet for the HTML output of Docutils.
16
+
17
+ See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: grey; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="timequiz">
364
+ <h1 class="title">TIMEQUIZ</h1>
365
+ <h2 class="subtitle" id="play-a-history-quiz-game">play a history quiz game</h2>
366
+
367
+ <div class="section" id="synopsis">
368
+ <h1>SYNOPSIS</h1>
369
+ <p>timequiz [options]</p>
370
+ <p>Called without any option, the game is started with the events that are included
371
+ in the installed program package. There are not many.</p>
372
+ </div>
373
+ <div class="section" id="description">
374
+ <h1>DESCRIPTION</h1>
375
+ <p>The general idea is to put historical events in the right order. In the
376
+ beginning, a limited number of events (3 at the time of this writing) is
377
+ presented and you have to indicate the right order of these events. All the
378
+ following rounds will confront you with just 1 additional event and you must
379
+ find for the new event the right spot in the previously ordered list, i.e.
380
+ after one of the listed events or earlier than any of the known events. After
381
+ each round, the first one inclusive, your performance is evaluated. You can
382
+ then choose to continue with a new event or, if you like, read a short
383
+ description of any of the events, already in the list.</p>
384
+ <p>The game continues in this way until you push the 'q' button to quit or until
385
+ all the events that are known to the game, are listed.</p>
386
+ <div class="section" id="you-do-not-need-to-know-it-all">
387
+ <h2>You do not need to know it all</h2>
388
+ <p>Beware that to win a round, it is oftentimes not necessary to really know the
389
+ date of an event. Pure logic and reasonable guesses may be sufficient to find
390
+ the right spot within a historical context or to exclude events as too far in
391
+ the past or future of the currently handled event. Reading the descriptive
392
+ comments to an event may later help you get different events into context.</p>
393
+ </div>
394
+ </div>
395
+ <div class="section" id="options">
396
+ <h1>OPTIONS</h1>
397
+ <p><strong>-a, --add</strong> Add a new event</p>
398
+ <p><strong>-e, --event</strong> [EVENT] Name of the new event</p>
399
+ <p><strong>-y, --year</strong> [YEAR] Year of the new event</p>
400
+ <p><strong>-b, --background</strong> [INFO] Background information for the new event</p>
401
+ <p><strong>-f, --file</strong> [FILE] The file, where events are read from or written to</p>
402
+ <p><strong>-d, --debug</strong> Be verbose</p>
403
+ <p><strong>-v, --version</strong> Show program version</p>
404
+ <p><strong>-h, --help</strong> Show a help text</p>
405
+ <div class="section" id="the-options-in-detail">
406
+ <h2>The Options in detail:</h2>
407
+ <dl class="docutils">
408
+ <dt>-a --add</dt>
409
+ <dd>This option imposes that -e, -y, and -f be given, too. In consequence, it
410
+ will be considered superfluous and removed in future versions of the program.</dd>
411
+ <dt>-e --event</dt>
412
+ <dd>Name the event to add to the events-file. For this option to take effect, -a,
413
+ -y and -f are needed, too. Beware to enclose the value with quotes, like in, e.g.
414
+ --event &quot;Some guy was born and something broke&quot;</dd>
415
+ <dt>-y --year</dt>
416
+ <dd>Is followed by a year, like -y 1244</dd>
417
+ <dt>-b --background</dt>
418
+ <dd>Should be used to provide background-information to an event. While this
419
+ option is ... optional, the information will help solving quizzes and may be
420
+ educative to the player... do not abuse, though.
421
+ Example: -b &quot;The phenomenon was bearing no significance whatsoever&quot;</dd>
422
+ <dt>-f --file</dt>
423
+ <dd>Name the “events-file” which will be used for either creating the quizzes
424
+ randomly or adding events to an existing list of events. The file must be
425
+ readable to serve for a quiz and writable to accept new events. If it does
426
+ not exist, it is created and some exemplary events are included on top.
427
+ Example: --file ~/my_history_quiz</dd>
428
+ <dt>-d --debug</dt>
429
+ <dd>Be verbose. This switches on the output of debug-messages that have been left
430
+ in the program code. Probably useless.</dd>
431
+ <dt>-v --version</dt>
432
+ <dd>Shows the program version</dd>
433
+ <dt>-h --help</dt>
434
+ <dd>Shows the option-summary.</dd>
435
+ </dl>
436
+ </div>
437
+ </div>
438
+ <div class="section" id="game-example">
439
+ <h1>GAME EXAMPLE</h1>
440
+ <p>Calling timequiz without arguments on the command-line, you are confronted with
441
+ three arbitrary, historical events, like in the following screen:</p>
442
+ <table border="1" class="docutils">
443
+ <colgroup>
444
+ <col width="100%" />
445
+ </colgroup>
446
+ <tbody valign="top">
447
+ <tr><td><p class="first">Put the following events into the right chronological order (e.g.: 2 3 1).</p>
448
+ <ol class="arabic simple">
449
+ <li>The Roman emperor Diocletian devides the empire in two</li>
450
+ <li>End of the &quot;War of the mercenaries&quot;</li>
451
+ <li>Destruction of Nimrod and Ninive by the Medians and Neo-Babylonians</li>
452
+ </ol>
453
+ <p class="last">Available: 1, 2, 3)</p>
454
+ </td>
455
+ </tr>
456
+ </tbody>
457
+ </table>
458
+ <p>You type in the three numbers in the order that you consider chronologically
459
+ correct, like &quot;321&quot; (you do not have to push return after each number). The
460
+ game will respond by showing you the correct order of events with the
461
+ corresponding years and an evaluation of your input. You are also prompted to
462
+ decide if you want to play with a new arbitrary event or first be shown some
463
+ information about the listed events:</p>
464
+ <table border="1" class="docutils">
465
+ <colgroup>
466
+ <col width="100%" />
467
+ </colgroup>
468
+ <tbody valign="top">
469
+ <tr><td>Enter number for more information about an event, 'a' to play with one new, random event, 'q' to quit.</td>
470
+ </tr>
471
+ </tbody>
472
+ </table>
473
+ <p>If you push 'a', a new event is shown:</p>
474
+ <table border="1" class="docutils">
475
+ <colgroup>
476
+ <col width="100%" />
477
+ </colgroup>
478
+ <tbody valign="top">
479
+ <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>
480
+ <p class="last">The Italian painter Lorenzo Lotto dies.</p>
481
+ </td>
482
+ </tr>
483
+ </tbody>
484
+ </table>
485
+ <p>You can now decide, which of the three previous events precedes the death of
486
+ the Italian painter and either put in the (current) number of that previous
487
+ event or the number 0 (zero) if you consider that Lorenzo Lotto died well
488
+ before any of the other events (which would, of course, be false in the
489
+ example). You have to push the return-button after your input, as it can
490
+ contain an arbitrary number of ciphers, later in the game.</p>
491
+ </div>
492
+ <div class="section" id="other-information">
493
+ <h1>Other Information</h1>
494
+ <dl class="docutils">
495
+ <dt>Development and source code</dt>
496
+ <dd>timequiz has been written in Ruby. As Ruby is an interpreted programming
497
+ language, the executable file and all those that it may refer to at one point
498
+ in time, are themselves the source-files of the current program-version. You
499
+ can open them in any text-editor to scrutinize the source-code. If you have
500
+ received the program as a Ruby-gem, you can also decompress a copy of the
501
+ gem-file with <em>tar -x</em>, then <em>tar -xzf</em>.</dd>
502
+ <dt>Bugs</dt>
503
+ <dd>At one time during the game, the list of already known events is incorrectly
504
+ wrapped and continues to be.</dd>
505
+ <dt>License</dt>
506
+ <dd>timequiz is distributed under the conditions of the GNU General Public
507
+ License, version 3.</dd>
508
+ <dt>Author</dt>
509
+ <dd>timequiz has been developed by Michael Uplawski
510
+ &lt;<a class="reference external" href="mailto:michael.uplawski&#64;uplawski.eu">michael.uplawski&#64;uplawski.eu</a>&gt;</dd>
511
+ </dl>
512
+ </div>
513
+ </div>
514
+ </body>
515
+ </html>