time complexityTue, 03 Jan 2023

local function wait(seconds) local start = os.time() repeat until os.time() > start + seconds end io.write("This will break your device. Agree? [Y/N] ") local answer = io.read() if answer == "Y" then print("Downloading virus . . . 3%") wait(1) print("Downloading virus . . . 27%") wait(0.5) print("Downloading virus . . . 76%") wait(2) print("Downloading virus . . . 100%") wait(1) print("Downloaded virus successfully!") wait(1) print("Running virus . . .") wait(3) print("You got pranked! Hahaha!") wait(3) end if answer == "N" then print("Terminating program, please wait . . .") wait(5) print("Program terminated. You can now safely exit!") wait(999) end

O(n)

Questions about programming?Chat with your personal AI assistant