i spent hours trying to get this program to run for the bit and then gave up and just faked it with a shell script. why am i like this :)
edit: i did a bit of hacking to bypass parts of the code that weren't working in the emulator, and confirmed that the program will behave exactly like the screenshot: https://furry.engineer/@nil/113755546111532838