icoa-cli 2.19.36 → 2.19.37

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.
@@ -183,17 +183,29 @@ function printHowToPlay() {
183
183
  console.log(chalk.gray(' ru · hi · de · id · th · vi · tr'));
184
184
  console.log(chalk.gray(' ─────────────────────────────────────────'));
185
185
  }
186
- // Australian easter eggs every 3 questions (for 15-question demo)
187
- function getEasterEggs() {
188
- return {
189
- 3: { emoji: '🏛️', text: t('egg3') },
190
- 5: { emoji: '🐨', text: t('egg5') },
191
- 7: { emoji: '🌉', text: t('egg7') },
192
- 9: { emoji: '🦘', text: t('egg9') },
193
- 11: { emoji: '🏖️', text: t('egg11') },
194
- 13: { emoji: '🦈', text: t('egg13') },
195
- 15: { emoji: '🎉', text: t('egg15') },
196
- };
186
+ // Australian easter eggs at percentage-based positions. The messages were
187
+ // originally written for a 15-question exam; we now map them by percentage
188
+ // so they fire at the right moment regardless of question count (10 or 15).
189
+ function getEasterEgg(current, total) {
190
+ const EGGS = [
191
+ { pct: 0.20, emoji: '🏛️', key: 'egg3' }, // Great start
192
+ { pct: 0.33, emoji: '🐨', key: 'egg5' }, // 1/3 done
193
+ { pct: 0.50, emoji: '🌉', key: 'egg7' }, // Keep going (halfway)
194
+ { pct: 0.60, emoji: '🦘', key: 'egg9' }, // Past halfway
195
+ { pct: 0.80, emoji: '🏖️', key: 'egg11' }, // Almost there
196
+ { pct: 0.87, emoji: '🦈', key: 'egg13' }, // 2 more to go
197
+ { pct: 1.00, emoji: '🎉', key: 'egg15' }, // All done
198
+ ];
199
+ const seen = new Set();
200
+ for (const egg of EGGS) {
201
+ const targetQ = Math.round(egg.pct * total);
202
+ if (targetQ < 1 || seen.has(targetQ))
203
+ continue;
204
+ seen.add(targetQ);
205
+ if (current === targetQ)
206
+ return { emoji: egg.emoji, text: t(egg.key) };
207
+ }
208
+ return undefined;
197
209
  }
198
210
  function printQuestionProgress(current, total, answered) {
199
211
  const width = 30;
@@ -220,9 +232,9 @@ function printQuestion(q, answer) {
220
232
  const eliminated = help.eliminated[q.number] || [];
221
233
  // Progress bar
222
234
  printQuestionProgress(q.number, total, answered);
223
- // Easter egg
224
- const egg = getEasterEggs()[q.number];
225
- if (egg && q.number <= total) {
235
+ // Easter egg (position calculated by percentage of total)
236
+ const egg = getEasterEgg(q.number, total);
237
+ if (egg) {
226
238
  console.log(chalk.yellow(` ${egg.emoji} ${egg.text}`));
227
239
  }
228
240
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.36",
3
+ "version": "2.19.37",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {