trying to trigger victory on quit need help ASAP

I’m writing a story for a class I’m taking the objective is to have the player quit the game thus achieving victory. But I’ve been unable to figure out how to successfully code that action. I’m running out of time and ideas so any help would be greatly appreciated.

the point of the game is to allow players to interact with concept of Huizinga’s magic circle. The victory condition of the game is intended to force player to stop playing the game thus breaking the circle if the player doesn’t quit and takes any of the actions they’ve been directed to take the game will restart.

in execution this could be a fake quit or a real one the aim is simply for the player to get frustrated and enter “quit” into the command line.

Wouldn’t just a simple " instead of quitting work?

Almost, except that quitting the game is an out-of-world action, so it has no instead rules. But you could do:

Carry out quitting the game: say "Are you sure you want to quit? "; if the player consents: end the story finally saying "You quit."; otherwise: rule fails.