Transporter Safety
Stardate 55141.5 ยท UES Magnanimous
Briefing
The other Magnanimous has opened a channel. There is nobody on it, only their computer, and their computer is asking for a technician. Commander Raghunathan has volunteered, and Chief T'Kala has responded by writing down, in order, every reason the transporter should refuse to send her.
Shields up: refuse, and say so, because that one kills you. Cargo over five hundred kilos: refuse, the pattern buffer will not hold it. Lock quality below 0.9: refuse, because ninety percent of a Commander is not a Commander. The transporter must give the first applicable reason in that order, or, if there is none, permit the transport. The Captain has asked whether "permit" means "should". It does not.
Mission objectives
ARCHIE checks all five every time you run diagnostics.
- โขShields up is refused first, whatever else is true
- โขToo heavy is refused when shields are down
- โขA weak lock is refused when the mass is fine
- โขEverything in order: permitted
- โขExactly 500 kilograms and a lock of exactly 0.9 are both still fine
Objective
Write transport_refusal(shields_up, mass_kg, lock_quality). Return the
first applicable reason as a string, checking in this order:
"shields are up" if shields_up; "too heavy" if
mass_kg is over 500; "weak lock" if lock_quality
is below 0.9. If none apply, return None: the transport is permitted.
Press Run Diagnostics and I will tell you which objectives you actually met.
Objective
Write transport_check(shields_up: bool, mass_kg: u32, lock_quality: f64) ->
Result<(), &'static str>. Return the first applicable
refusal, checking in this order: Err("shields are up") if
shields_up; Err("too heavy") if mass_kg is over
500; Err("weak lock") if lock_quality is below 0.9. If none
apply, return Ok(()): the transport is permitted.
Press Run Diagnostics and I will tell you which objectives you actually met.
Ask Commander Raghunathan for a hint
Three checks in the stated order, each returning immediately with its reason. The last objective is the boundary: 500 is not over 500, and 0.9 is not below 0.9. Python returns the reason or None; Rust returns a Result where Ok(()) is permission.
Debrief
Shields down, 71 kilograms, lock at 0.98: permitted. Commander Raghunathan is standing on the other ship's transporter pad, and the first thing she has said over the channel is that it smells the same. The second thing is that their coffee replicator is working perfectly.
First Contact complete. The Anomaly is open, and it is going to be about what, precisely, is on the other ship's computer.