8
You're going to replicate the 90's cup holder joke software.
Here's what's it did, and you have to do:
- Display the message
Do you need a cup holder?
- If the user confirms, enter an infinite loop that keeps opening the CDROM drive.
- If the user doesn't confirm, silently exit.
You may display the message using either a console message (confirmation is y, decline is n), or display a message window with the two options "Yes" and "No". You can assume the default (or most common) CDROM drive (D:
on Windows, /cdrom
on linux etc.). Standard loopholes (except built-ins) are forbidden. No additional input nor output may be involved. If your PC has no physical drive, or another "style" of tray, make sure the program is valid.
code-golf, so shortest program in bytes wins.
Trivia: The loop is there to prevent anyone from closing the drive. On desktop drives, the re-open command will be sent while the drive is closing, therefore staying open and not "spilling the coffee".
2
Minus the necessary CD eject system call, I think this is strikingly similar to http://codegolf.stackexchange.com/questions/62732/implement-a-truth-machine
– Digital Trauma – 2016-02-03T00:17:28.7304I think the requirement to interact with the hardware makes this sufficiently distinct from Implement a Truth Machine. – Alex A. – 2016-02-03T03:06:20.303
FYI http://meta.codegolf.stackexchange.com/a/8214/8478 (specifically "having long fixed output strings that benefit from compression.").
– Martin Ender – 2016-02-03T08:33:56.010