Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 23rd, 2013  |  syntax: Python  |  size: 0.52 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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]()