12
2
Most of us LOST fans out there remember the computer that Desmond had to type the characters "4 8 15 16 23 42" in every 108 minutes or the world would end (or would it?).
The challenge here is to create a program that would do the same thing by requiring that every 108 seconds the input 4 8 15 16 23 42
is entered or it will display the message
Sorry, the world has ended with status code -1
It should warn the user at 100 seconds that they need to enter a number with the message
Enter, Quick!
The program must be able to read input at any time and if it is the correct input it will reset the timer. If incorrect input is given nothing happens.
The program should run indefinitely. So the timeline after the last valid input looks like
From 0 to 99 seconds: no output
At 100 seconds: Enter, Quick!
At 108 seconds: Sorry, the world has ended with status code -1
.
This is code golf so the shortest answer (in bytes) that accomplishes this task wins! Good Luck!
I've edited the question a bit. Feel free to rollback any changes you don't want. – Martin Ender – 2015-09-17T22:33:24.070
2There should be bonus points for outputting the correct hieroglyphics. – curiousdannii – 2015-09-18T01:44:44.273
After re-reading the challenge, I'm not sure anymore I've interpreted it correctly. What should happen after the "the world has ended"? – Dennis – 2015-09-18T03:22:36.210
1As a lost-nerd, I feel obligated to point out that Desmond would be warned about entering the numbers 4 minutes (240 seconds) before the timer runs out. – James – 2015-09-18T04:15:08.057