๐Ÿงญ Helm

One Hundred and Forty Percent

Stardate 55109.0 ยท UES Magnanimous

Briefing

The shield status display on the bridge currently reads 140%. This is not a real number. Commander Raghunathan has explained, twice, that the emitters physically cannot exceed full charge and that the display is simply not being clamped. Ensign Tannenbaum has asked whether 140% could be "a stretch goal".

Separately, during the last drill the same display read -20%, which briefly convinced two junior officers that the ship had negative shields, whatever those would be. The Commander would like both ends of the range dealt with, today.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขA negative reading is clamped to 0
  • โ€ขZero stays zero
  • โ€ขA normal reading passes through unchanged
  • โ€ขExactly 100 stays 100
  • โ€ขAn overcharged reading is clamped to 100
Ask Commander Raghunathan for a hint

Two comparisons, or a pair of min/max calls. Rust has .clamp(0, 100), which is one method and worth knowing.