A hybrid input()
function allows us to use
the hasty
flag to speed through Paranoia
without a stop. The tests for \(1 / 0\) and \(0 / 0\) request
user permission to proceed. Some older machines would summarily
halt execution at either of those operations.
def alt_input(s):
"""Local version of input allows hasty execution."""
if hasty:
print(s)
reply = "y"
else:
reply = input(s)
return reply
The spirit of Paranoia is to have the user follow along as
testing proceeds. The pause()
function gives the
user the chance to catch up with the latest messages. It updates
the page number and milestone and prints a header for a new
"page" of output.
Pauses arise in the normal course of Paranoia, but may arise in some exceptional circumstances too, such as \(x \times y \neq y \times x\). This means slightly different page numbers and milestones can be seen on different arithmetics.
def pause():
"""Wait until the user hits RETURN."""
global milestone, page_num
s = alt_input("\nTo continue, press RETURN ")
print("\nDiagnosis resumes after milestone Number ", milestone,
" Page: ", page_num, "\n")
milestone += 1 # the only incremental change to milestone
page_num += 1
return