SHARE
TWEET

Untitled

a guest Sep 23rd, 2013 244 Never
  1. BEGIN_PROGRAM = {
  2.     1   :lambda: goto(2) if response == "yes" else goto(3) if response == "no" else goto 100,
  3.     2   :lambda: print("Thanks for the yes!") or goto(20),
  4.     3   :lambda: print("Thanks for the no!") or goto(20),
  5.     20  :lambda: end(),
  6.     100 :lambda: print("You're annoying me - answer the question!") or goto(1)
  7. }
  8.  
  9. # pay no attention to the code below the curtain
  10.  
  11. def goto(linenum):
  12.     global line
  13.     line = linenum
  14.  
  15. def end():
  16.     goto(0)
  17.  
  18. line = 1
  19. while line:
  20.     BEGIN_PROGRAM[line]()
RAW Paste Data
Top