RosettaCodeData/Task/Program-termination/Wren/program-termination.wren
2023-07-01 13:44:08 -04:00

10 lines
271 B
Text

import "io" for Stdin, Stdout
System.write("Do you want to terminate the program y/n ? ")
Stdout.flush()
var yn = Stdin.readLine()
if (yn == "y" || yn == "Y") {
System.print("OK, shutting down")
Fiber.suspend() // return to OS
}
System.print("OK, carrying on")