Sorrento and the Sixers have launched a covert operation to seize control of a hidden Easter Egg vault beneath Castle Anorak. But their encrypted plan was accidentally dumped to a public node thanks to an OASIS glitch triggered by Art3mis and Aech.
You—Parzival’s stealth-tech ally—must hack the plan, flag suspicious moves, scramble the file before the Sixers catch on, and deploy counter-strategies to protect the Egg.
All you have is a flickering terminal and a copy of their plan.
Write a function that will create the initial text file. This is the FIRST thing that must run.
The file should be named ioi_heist.txt and contain:
Step 1: Disguise as janitor
Step 2: Steal vault key
Step 3: Bribe guards with 500 coins
Create a menu-driven Python program that simulates the OASIS console. The program should:
Use with statements for reading and writing
Handle file errors with try/except
Let the user interact through a looping menu
Feel like you’re inside the OASIS, working against IOI
Code the terminal Menu to look something like this
You can use creative freedom here, and change things however you'd like, but the main tasks must be able to be accomplished from here
1: Scan the Full Heist Plan
Use with open("ioi_heist.txt", "r") and .read() to display the entire file contents at once.
Print it under the dramatic header "=== Intercepted Transmission ===" to simulate discovering a secret IOI communication dump.
2: Decode Line by Line
Use with open("ioi_heist.txt", "r") and .readlines() to load the contents into a list.
For each line, ask the user if it’s suspicious with the prompt: Is '[line]' suspicious? (yes/no).
If the user answers yes, print Flagged: [line] and store the flagged line in a list.
After reviewing all lines, print the full list of flagged steps with Suspicious Steps: [list].
This mirrors the kind of threat analysis an OASIS rebel would conduct when decoding corrupt IOI missions.
3: Deploy a Counter Move
Prompt the user for a strategy to sabotage IOI, such as “Lock the vault tight.”
Use with open("resistance_moves.txt", "a") to append this to a resistance file, formatting it like Resistance Move: [user’s input].
4: Log the Loot at Stake
Ask the user how many coins IOI is targeting with the prompt: How many coins is IOI targeting?.
Use with open("loot_risk.txt", "w") to write this number to a file, formatted as IOI Target: [amount] coins.
This simulates tracking high-value digital currency targets, similar to bounty tracking or leaderboard hacking in the OASIS.
5: Scramble IOI’s File
Use open("ioi_heist.txt", "r") and .readlines() to load the file.
Count how many lines contain the words "coins" or "vault". If any are found, overwrite the file using 'w' mode and replace the contents with the message SYSTEM ERROR – FILE CORRUPTED.
Print Sabotage Successful! to confirm.
6: Abort Mission
End the program loop and print the cinematic exit line Disconnecting from OASIS... Mission Terminated. to simulate logging out of the system like a true Gunter finishing their recon.
7: Rewire the Terminal (Bonus)
Use open("ioi_heist.txt", "r") to read the first line with .readline(), and print the current file pointer position using .tell().
Then ask the user: Enter a byte position to seek to:.
Use .seek() to jump to that position and read the next line or data from that spot.
Print the result as Terminal Rewired! Data scrambled. to simulate poking around IOI’s code or memory bank to discover or manipulate hidden data.
Before you launch any countermeasures, Parzival insists you verify the file’s integrity. One wrong move and the entire OASIS terminal could crash—or worse, trigger an IOI trace. As the Resistance's stealth-tech expert, your next task is to inspect the file object properties and confirm everything is safe to read, write, or append.
You'll tap into the system's internal diagnostic function to learn about:
file.name: Are you targeting the correct file?
file.mode: Are you writing, reading, or appending?
file.closed: Is the file safely closed or still in use?
file.readable(): Can you actually read the contents?
file.writable(): Will this file accept your sabotage or counter move?
Add the following to your OASIS Terminal menu:
8: Run File Diagnostics
Open ioi_heist.txt in read mode.
Display the following file properties while the file is open:
After the with block ends, print:
File closed? [file.closed]
For students who finish early:
Run diagnostics on any file (e.g., resistance_moves.txt, loot_risk.txt) by prompting for a filename instead of hardcoding it.
Add error handling in case the file doesn’t exist.