Advertisement
MrsMcLead

ECS Choose Your Own Adventure

Nov 19th, 2013
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. from tkinter import *
  2. import tkinter.simpledialog
  3. import tkinter.messagebox
  4. import random
  5.  
  6. root = Tk()
  7. w = Label(root, text="Choose Your Own Adventure")
  8. w.pack()
  9.  
  10. def intro():
  11.     choice = tkinter.simpledialog.askinteger("Choose wisely", "The first part of your story goes here.  Then you have a choice to pick 1 or 2.")
  12.     if (choice == 1):
  13.         choice1();
  14.  
  15.     elif (choice == 2):
  16.         tkinter.messagebox.showinfo("The End", "You chose wrong.  THE END")
  17.  
  18.  
  19. def choice1():
  20.     choice = tkinter.simpledialog.askinteger("Choose wisely", "This is the next part of the story.  Now you must choose 1 or 2 again.")
  21.     if (choice == 1):
  22.         tkinter.messagebox.showinfo("The End", "You chose right.  THE END")
  23.  
  24.     elif (choice == 2):
  25.         tkinter.messagebox.showinfo("The End", "You chose ok.  THE END")
  26.  
  27.  
  28. intro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement