timequiz 1.2 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a0517e2a94d008d80ebd5127361bbdabf479cedd87815c7237e7139d94afdf6
4
- data.tar.gz: 9a08de0793bb656b9496ce192158f5f418ef5516ffdc4719a25efed61e668f1d
3
+ metadata.gz: 2b091415dfe525da2e52aac9047c44ab09b4d4a3aba68091be2e537a409610d4
4
+ data.tar.gz: 10ce3ea7d1e5eb27ac3a25ff51dd787696c826859b12861b4a3caf3c71702e14
5
5
  SHA512:
6
- metadata.gz: c44ef9a1ebab50745bde35f83a5189bebab1ef735b5ca9529d2ca3927f9e44aa9250ad449c9c4b9047414fbfc359e160e905a783b34c42744421209264c684ca
7
- data.tar.gz: 33a3622ca2894f89d2134f0588d9aebdeec60dfbf7008540d2d9ba00d98245e5130d8cadc462dfbaa19df3a9c35c88c4dc5a1f88ea64450e5cd0780ce9846575
6
+ metadata.gz: a7779e38b0ddcd686b1c08ccbff7fca8625eb49bccbefb6ee917ff3cce064deed65d5efd1fb12f01a0f38cc953b537e0eeb2a353825b3069d6051fda1cd53855
7
+ data.tar.gz: 67fe251eb42dd86133ab690b0512a6cbe77312a919fdf76bfba05257eccebe1fb4c35da661089227feda88c874e8a35f22c35a281d5b7eb9e1087054b08ff5f0
data/changes.txt CHANGED
@@ -1,3 +1,9 @@
1
+ V 1.3
2
+ -) When the game ends, either after the maximum number
3
+ of events have been handled or because there are no
4
+ more events available, the user can still choose to
5
+ read the details for one of the listed events.
6
+
1
7
  V 1.2
2
8
  -) Bugfix: Word wrapping
3
9
  * does no longer eliminate dashes.
data/lib/console.rb CHANGED
@@ -82,7 +82,10 @@ module Console
82
82
  end
83
83
  if('a' == ui)
84
84
  ev = new_event
85
- # all known events have been handled.
85
+ # All currently defined events have been handled.
86
+ # This necessitates that MAX_NUM_EVENTS is identical with – or bigger
87
+ # than the number of known events and that the game has been going on
88
+ # for quite a long time.
86
89
  if ev == :all_events_done
87
90
  score(@@points, true)
88
91
  exit true
@@ -120,7 +123,14 @@ module Console
120
123
  detail( a2i(ui) )
121
124
  end
122
125
  end
123
-
126
+ ui = end_game()
127
+ if ui == :quit_game
128
+ #score @@points, true
129
+ puts ""
130
+ exit true
131
+ else
132
+ detail( a2i(ui) )
133
+ end
124
134
  end
125
135
 
126
136
  def clear
@@ -167,10 +177,17 @@ module Console
167
177
  UserInput::input()
168
178
  end
169
179
 
180
+ def end_game
181
+ puts "\n#{$MAX_NUM_EVENTS} events have been put in the right order. GAME OVER."
182
+ puts "\nYou can still enter a number (and hit return) for more information about an event\n\tor 'q' to quit."
183
+ UserInput::input()
184
+ end
185
+
186
+
170
187
  def score(pts, all_done = false)
171
- intro = (all_done ? 'Final score' : 'Current score')
188
+ intro = (all_done ? 'Your FINAL SCORE is' : 'Current score')
172
189
  debug('all_done? ' << all_done.to_s)
173
- puts ' (' << intro << ': %i %s)' %[pts, (pts == 1 ? 'point' : 'points')]
190
+ puts intro.dup << ': %i %s' %[pts, (pts == 1 ? 'point' : 'points')]
174
191
  end
175
192
 
176
193
  def lose
data/lib/events.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #encoding: UTF-8
2
2
  =begin
3
3
  /***************************************************************************
4
- * ©2017-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
4
+ * ©2017-2026, Michael Uplawski <michael.uplawski@uplawski.eu> *
5
5
  * *
6
6
  * This program is free software; you can redistribute it and/or modify *
7
7
  * it under the terms of the WTFPL 2.0 or later, see *
data/lib/extstring.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #encoding: UTF-8
2
2
  =begin
3
3
  /***************************************************************************
4
- * ©2017-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
4
+ * ©2017-2026, Michael Uplawski <michael.uplawski@uplawski.eu> *
5
5
  * *
6
6
  * This program is free software; you can redistribute it and/or modify *
7
7
  * it under the terms of the WTFPL 2.0 or later, see *
data/lib/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  =end
17
17
 
18
18
  APPNAME = 'Timequiz'
19
- VERSION = '1.2'
19
+ VERSION = '1.3'
20
20
  SUMMARY = 'Play a history game'
21
21
  AUTHOR = 'Michael Uplawski'
22
22
  AUTHOR_MAIL = '<michael.uplawski@uplawski.eu>'
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: '1.2'
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-09 00:00:00.000000000 Z
10
+ date: 2026-09-13 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: A game that makes you put historical events in chronological order.
13
13
  email: michael.uplawski@uplawski.eu