The comms log is full of entries like LAUNCH;GATE 4;0900;READY. Each one packs four facts into one string, with a semicolon between them.
Rocket squints. "Which part is the gate? Which part is the time?"
Raven points at the semicolons. "What do you notice? The gate is always the second piece, and the time is always the third." Nova draws four glowing boxes. "Would you like a hint? Cut first. Then use an index."
Each log entry has the same shape. That makes it easy to decode.
entry = "LAUNCH;GATE 4;0900;READY"
parts = entry.split(";")
print(parts[1])
print(parts[2])
print(len(parts))
print(" | ".join(parts)) | The screen shows |
|---|
| GATE 4 |
| 0900 |
| 4 |
| LAUNCH | GATE 4 | 0900 | READY |
| Index | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Meaning | event | gate | time | status |
The space inside GATE 4 stays. split only cuts at the separator you give it.
entry = "DOCK;BAY 2;1430;WAIT"
parts = entry.split(";")
print(parts[0])
print(parts[-1]) entry = "LAUNCH;GATE 7;1100;READY"
parts = entry.split(";")
if parts[3] == "READY":
print("Go at", parts[2])
else:
print("Hold") entry = "REFUEL;PAD 3;1615;DONE"
parts = entry.split(";")
print(parts[0])
print(parts[1])
print(parts[2][0:2]) | Statement about the refuel entry | True or false? |
|---|---|
| split(";") cuts the space inside PAD 3. | ? |
| parts[-1] is "DONE". | ? |
| len(parts) is 4. | ? |
| parts[1] is "REFUEL". | ? |
You decoded the log! Tomorrow, a hidden message is waiting inside it.