Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import tkinter.simpledialog
- import tkinter.messagebox
- import random
- root = Tk()
- w = Label(root, text="Choose Your Own Adventure")
- w.pack()
- def intro():
- choice = tkinter.simpledialog.askinteger("Choose wisely", "The first part of your story goes here. Then you have a choice to pick 1 or 2.")
- if (choice == 1):
- choice1();
- elif (choice == 2):
- tkinter.messagebox.showinfo("The End", "You chose wrong. THE END")
- def choice1():
- choice = tkinter.simpledialog.askinteger("Choose wisely", "This is the next part of the story. Now you must choose 1 or 2 again.")
- if (choice == 1):
- tkinter.messagebox.showinfo("The End", "You chose right. THE END")
- elif (choice == 2):
- tkinter.messagebox.showinfo("The End", "You chose ok. THE END")
- intro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement