by Max Barry

Latest Forum Topics

Advertisement

Search

Search

[+] Advanced...

Author:

Region:

Sort:

«12. . .29,38829,38929,39029,39129,39229,39329,394. . .44,43544,436»

Ah yes, I again am once again stricken with strange maladies.

it's like, middle of the day and yet i'm still so half awake that i read "strange maladies" as "orange marmalade".

Bunnies, The Municipalities of Antarctica, Alantic empire, and Arthralonia

Rockemsockem wrote:it's like, middle of the day and yet i'm still so half awake that i read "strange maladies" as "orange marmalade".

Pfffff. I understand this feeling. I've had it ever since I started the EOF.

The Municipalities of Antarctica wrote:Pfffff. I understand this feeling. I've had it ever since I started the EOF.

Speaking of being in high amounts of confusion, i think you might have the conversion lengths on your heavy cruiser class wrong.

Hello my fellow people. How do you do?

More importantly, guess what time it is? You guessed correctly, its code update time! Another update so yall can see how useful my time has been

import tkinter as tk
import random as rand
from time import time

t_start = time()
window = tk.Tk()
window.geometry("800x500")

var = tk.StringVar()
name_var = tk.StringVar()
name = name_var.get()

frame1 = tk.Frame(window, width=800, height=500)
frame1.pack()
frame2 = tk.Frame(window, width=800, height=500)
frame2.pack_forget()
frame3 = tk.Frame(window, width=800, height=500)
frame3.pack_forget()
frame4 = tk.Frame(window, width=800, height=500)
frame4.pack_forget()
frame5 = tk.Frame(window, width=800, height=500)
frame5.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame7 = tk.Frame(window, width=800, height=500)
frame7.pack_forget()
frame8 = tk.Frame(window, width=800, height=500)
frame8.pack_forget()
frame9 = tk.Frame(window, width=800, height=500)
frame9.pack_forget()

canvas1 = tk.Canvas(frame1,width=800,height=500,bg='cyan')
canvas1.pack()
canvas2 = tk.Canvas(frame2,width=800,height=500,bg='cyan')
canvas2.pack_forget()
canvas3 = tk.Canvas(frame3,width=800,height=500,bg='cyan')
canvas3.pack_forget()
canvas4 = tk.Canvas(frame4,width=800,height=500,bg='sky blue')
canvas4.pack_forget()
canvas5 = tk.Canvas(frame5,width=800,height=500,bg='coral')
canvas5.pack_forget()
canvas6 = tk.Canvas(frame6,width=800,height=500,bg='azure')
canvas6.pack_forget()
canvas7 = tk.Canvas(frame7,width=800,height=500,bg='spring green')
canvas7.pack_forget()
canvas8 = tk.Canvas(frame8,width=800,height=500,bg='gold')
canvas8.pack_forget()
canvas9 = tk.Canvas(frame9,width=800,height=500,bg='purple')
canvas9.pack_forget()

lbl = tk.Label(window, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
count_lvl = [0,0,0,0,0,0]

def show_frame_2():
frame1.pack_forget()
frame2.pack()
canvas2.pack()

def finish(s):
AA = ["A","A","A","A","A"] # Change this to Level_6 options
global count_lvl

if(AA[s] == var.get()):
frame8.pack_forget()
frame9.pack()
canvas9.pack()
t_end = time()
elapsed_time = t_end - t_start
text_q = tk.Label(canvas9, text="Game Finished \n Time taken "+ str(round(elapsed_time,1)) + " Seconds",font=("Helvetica", 30),bg='purple',fg='yellow')
text_q.place(relx = 0.5,
rely = 0.5,anchor = 'center')
print(name)
else:
count_lvl[5] = count_lvl[5] + 1
print(count_lvl[5])

def level_6(s):
AA = ["A","A","B","D","C"] # Change this to Level_5 options
global count_lvl
lbl = tk.Label(canvas8, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if(AA[s] == var.get()):
frame7.pack_forget()
frame8.pack()
canvas8.pack()

q = ["Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?"]
x = rand.randint(0,4)
level_6_txt = tk.Label(canvas8, text="Level Six",font=("Times New Roman", 18),bg='gold')
text_q = tk.Label(canvas8, text=q[x],font=("Helvetica", 18),bg='gold')
A = [["A: No","B: Yes","C: Yes","D: Yes"],["A: No","B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No","B: Yes","C: Yes","D: Yes"]]
AA = ["A","A","A","A","A"] # Change this to Level_6 options
text_q.place(x=100,y=90)
level_6_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas8, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=300)

lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)

else:
count_lvl[4] = count_lvl[4] + 1
r1 = tk.Radiobutton(canvas8, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text="").place(x=100,y=300)
print(count_lvl[4])

def level_5(s,length):
AA = ["C","B","A","D","C"] # Change this to Level_4 options
global count_lvl
lbl = tk.Label(canvas7, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25, command=lambda: level_6(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame6.pack_forget()
frame7.pack()
canvas7.pack()

q = ["Q: The USSR was following what type of economy?","Q: A market equilibrium is when the quantity demanded meets quantity supplied","Q: What type of sequence is '2, 4, 8, 16, 32?","Q: Factorise '3x+36'","Q: Factorise 'x2 +4x-12’"] # Change this
x = rand.randint(0,4)
level_5_txt = tk.Label(canvas7, text="Level Five",font=("Times New Roman", 18),bg='spring green')
text_q = tk.Label(canvas7, text=q[x],font=("Helvetica", 18),bg='spring green')
A = [["A: Planned economy","B: Mixed economy","C: Market economy","D: None of the above"],["A: True","B: False"],["A: Arithmetic", "B: Geometric", "C: Quadratic", "D: 1815"],["A: 3 x X x 36", "B: X+12", "C: No Thanks", "D: 3(x+12)"],["A: (x+2)(x-6)","B: 2(x-2)(x+6)","C: (x-2)(x+6)","D: 2(2x-6)"]] # Change this
AA = ["A","A","B","D","C"] # Change this to Level_5 options
text_q.place(x=100,y=90)
level_5_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)

lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25,command=lambda: level_6(x)).place(x = 200, y = 400)

else:
count_lvl[3] = count_lvl[3] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
print(count_lvl[3])

def level_4(s,length):
AA = ["A","B","D","C","A"] # Change this to Level_3 options
global count_lvl
lbl = tk.Label(canvas6, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25, command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame5.pack_forget()
frame6.pack()
canvas6.pack()

q = ["Q: What is the specific heat capacity of water?","Q: What year was the first moon landing?","Q: George Orwell wrote 'Animal Farm'","Q: How many bones does the human body have?","Q: Where was the first paper book written?"]
x = rand.randint(0,4)
level_4_txt = tk.Label(canvas6, text="Level Four",font=("Times New Roman", 18),bg='azure')
text_q = tk.Label(canvas6, text=q[x],font=("Helvetica", 18),bg='azure')
A = [["A: 420J","B: 4200kJ","C: 4200J","D: 4100J"],["A: 1968","B: 1969", "C: 1970", "D: 1971"],["A: True", "B: False"],["A: 187", "B: 209", "C: 306", "D: 206"],["A: Russia","B: Britain","C: China","D: Austria"]]
AA = ["C","B","A","D","C"] # Change this to Level_4 options
text_q.place(x=100,y=90)
level_4_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)

lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25,command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[2] = count_lvl[2] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
print(count_lvl[2])

def level_3(s):
AA = ["D","B","C","B","A"] # Change this to Level_2 options
global count_lvl
lbl = tk.Label(canvas5, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25, command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame4.pack_forget()
frame5.pack()
canvas5.pack()

q = ["Q: Who killed Archduke Franz Ferdinand?","Q: What is 4/9 to the power of -1/2?","Q: What is an exothermic reaction?","Q: What is an endothermic reaction?","Q: How many centimetres in a kilometre?"] # Change this
x = rand.randint(0,4)
level_3_txt = tk.Label(canvas5, text="Level Three",font=("Times New Roman", 18),bg='coral')
text_q = tk.Label(canvas5, text=q[x],font=("Helvetica", 18),bg='coral')
A = [["A: Gavrilo Princip","B: Gavilipo Princip","C: Gavrilip Princep","D: Gavip Prince"],["A: 2/3","B: 3/2", "C: -2/3", "D: 5/6"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbment of heat energy", "D: Expulsion of heat energy"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbing heat energy", "D: Expelling heat energy"],["A: 100,000cm","B: 10,000cm","C: 1,000,000cm","D: 10,000,000cm"]] # Change this
AA = ["A","B","D","C","A"] # Change this to Level_3 options
text_q.place(x=100,y=90)
level_3_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas5, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=300)

lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25,command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[1] = count_lvl[1] + 1
r1 = tk.Radiobutton(canvas5, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text="").place(x=100,y=300)
print(count_lvl[1])

def level_2(s):
global count_lvl
AA = ["A","B","D","A","B"] # Level_1 options
lbl = tk.Label(canvas4, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25, command=lambda: level_3(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame3.pack_forget()
frame4.pack()
canvas4.pack()

q = ["Q: What was Russia called after the Russian Empire?","Q: Who painted the Mona Lisa?","Q: When was the first tank used?","Q: What is the fear of spiders called?","Q: Who was the Prime Minister of Britain during WW2?"]
x = rand.randint(0,4)
level_2_txt = tk.Label(canvas4, text="Level Two",font=("Times New Roman", 18),bg='sky blue')
text_q = tk.Label(canvas4, text=q[x],font=("Helvetica", 18),bg='sky blue')
A = [["A: Russia","B: Russian Federation","C: Socialist Russia","D: USSR"],["A: Leonardo Da Caprio","B: Leonardo Da Vinci", "C: Leonardo Da Vinki", "D: Leonardo De Vinki"],["A: 1916", "B: 1914", "C: 1915", "D: 1815"],["A: Afraid-Of-Spiders-Phobia", "B: Arachnophobia", "C: No-Like-Spiders", "D: Arachnatoidophobia"],["A: Winston Churchhill","B: Winston Church","C: Neville Chaimberlain","D: Neville Churchhill"]]
AA = ["D","B","C","B","A"] # Level_2 options
text_q.place(x=100,y=90)
level_2_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas4, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=300)

lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,command=lambda: level_3(x)).place(x = 200, y = 400)

else:
count_lvl[0] = count_lvl[0] + 1
r1 = tk.Radiobutton(canvas4, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text="").place(x=100,y=300)
print(count_lvl[0])

def load_level_1():
frame2.pack_forget()
frame3.pack()
canvas3.pack()
q = ["Q: What is the square root of 64 plus the square root of 49?","Q: Can energy be created or destroyed?","Q: What is the gradient of a line on a graph?","Q: What is a cell?","Q: What equation is linked to the Pythagorean Theorem?"]
x = rand.randint(0,4)
level_1_txt = tk.Label(canvas3, text="Level One",font=("Times New Roman", 18),bg='cyan')
text_q = tk.Label(canvas3, text=q[x],font=("Helvetica", 18),bg='cyan')
A = [["A: 15","B: 13","C: 14","D: 16"],["A: Yes","B: No"],["A: The slide", "B: The height", "C: The length", "D: The slope"],["A: A microorganism that provides structure", "B: A prison cell", "C: A cell phone", "D: None of the above"],["A: A squared minus B squared equals C squared ","B: A squared plus B squared equals C squared","C: A squared times B squared equals C squared","D: A squared plus B squared equals C"]]
AA = ["A","B","D","A","B"]
text_q.place(x=100,y=90)
level_1_txt.place(x=0,y=0)
lbl = tk.Label(canvas3, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25, command=lambda: level_2(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (len(A[x]) == 4):
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas3, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas3, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=300)

else:
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)

# ----------------------- User Name input Window ------------------------------------------

lab1 = tk.Entry(canvas2, text = name_var,font=("Purisa",15)).place(x = 240,y = 120,width=410,height=70)
level_1 = tk.Button(canvas2,text="Next",font=("Purisa",20),width=25,command=load_level_1).place(x = 240, y = 200)

# ----------------------- Main Window ------------------------------------------

canvas1.create_text(120,70,anchor=tk.W,font=("Purisa",50),fill="black",text="Knowledge Masters")
ToMap = tk.Button(canvas1,text="Start",font=("Purisa",20),width=25,command=show_frame_2)
ToMap.place(x = 200, y = 150)
Quit = tk.Button(canvas1,text="Quit",font=("Purisa",20),width=25,command=quit)
Quit.place(x = 200, y = 210)
canvas2.create_text(270,70,anchor=tk.W,font=("Purisa",30),fill="black",text="Input the User name")

# ----------------------- Level-one Window ------------------------------------------

Rockemsockem wrote:Speaking of being in high amounts of confusion, i think you might have the conversion lengths on your heavy cruiser class wrong.

Do I?
Edit: Oh I do. Somehow.

True Europa State wrote:Hello my fellow people. How do you do?

More importantly, guess what time it is? You guessed correctly, its code update time! Another update so yall can see how useful my time has been

import tkinter as tk
import random as rand
from time import time

t_start = time()
window = tk.Tk()
window.geometry("800x500")

var = tk.StringVar()
name_var = tk.StringVar()
name = name_var.get()

frame1 = tk.Frame(window, width=800, height=500)
frame1.pack()
frame2 = tk.Frame(window, width=800, height=500)
frame2.pack_forget()
frame3 = tk.Frame(window, width=800, height=500)
frame3.pack_forget()
frame4 = tk.Frame(window, width=800, height=500)
frame4.pack_forget()
frame5 = tk.Frame(window, width=800, height=500)
frame5.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame7 = tk.Frame(window, width=800, height=500)
frame7.pack_forget()
frame8 = tk.Frame(window, width=800, height=500)
frame8.pack_forget()
frame9 = tk.Frame(window, width=800, height=500)
frame9.pack_forget()

canvas1 = tk.Canvas(frame1,width=800,height=500,bg='cyan')
canvas1.pack()
canvas2 = tk.Canvas(frame2,width=800,height=500,bg='cyan')
canvas2.pack_forget()
canvas3 = tk.Canvas(frame3,width=800,height=500,bg='cyan')
canvas3.pack_forget()
canvas4 = tk.Canvas(frame4,width=800,height=500,bg='sky blue')
canvas4.pack_forget()
canvas5 = tk.Canvas(frame5,width=800,height=500,bg='coral')
canvas5.pack_forget()
canvas6 = tk.Canvas(frame6,width=800,height=500,bg='azure')
canvas6.pack_forget()
canvas7 = tk.Canvas(frame7,width=800,height=500,bg='spring green')
canvas7.pack_forget()
canvas8 = tk.Canvas(frame8,width=800,height=500,bg='gold')
canvas8.pack_forget()
canvas9 = tk.Canvas(frame9,width=800,height=500,bg='purple')
canvas9.pack_forget()

lbl = tk.Label(window, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
count_lvl = [0,0,0,0,0,0]

def show_frame_2():
frame1.pack_forget()
frame2.pack()
canvas2.pack()

def finish(s):
AA = ["A","A","A","A","A"] # Change this to Level_6 options
global count_lvl

if(AA[s] == var.get()):
frame8.pack_forget()
frame9.pack()
canvas9.pack()
t_end = time()
elapsed_time = t_end - t_start
text_q = tk.Label(canvas9, text="Game Finished \n Time taken "+ str(round(elapsed_time,1)) + " Seconds",font=("Helvetica", 30),bg='purple',fg='yellow')
text_q.place(relx = 0.5,
rely = 0.5,anchor = 'center')
print(name)
else:
count_lvl[5] = count_lvl[5] + 1
print(count_lvl[5])

def level_6(s):
AA = ["A","A","B","D","C"] # Change this to Level_5 options
global count_lvl
lbl = tk.Label(canvas8, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if(AA[s] == var.get()):
frame7.pack_forget()
frame8.pack()
canvas8.pack()

q = ["Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?"]
x = rand.randint(0,4)
level_6_txt = tk.Label(canvas8, text="Level Six",font=("Times New Roman", 18),bg='gold')
text_q = tk.Label(canvas8, text=q[x],font=("Helvetica", 18),bg='gold')
A = [["A: No","B: Yes","C: Yes","D: Yes"],["A: No","B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No","B: Yes","C: Yes","D: Yes"]]
AA = ["A","A","A","A","A"] # Change this to Level_6 options
text_q.place(x=100,y=90)
level_6_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas8, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=300)

lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)

else:
count_lvl[4] = count_lvl[4] + 1
r1 = tk.Radiobutton(canvas8, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text="").place(x=100,y=300)
print(count_lvl[4])

def level_5(s,length):
AA = ["C","B","A","D","C"] # Change this to Level_4 options
global count_lvl
lbl = tk.Label(canvas7, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25, command=lambda: level_6(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame6.pack_forget()
frame7.pack()
canvas7.pack()

q = ["Q: The USSR was following what type of economy?","Q: A market equilibrium is when the quantity demanded meets quantity supplied","Q: What type of sequence is '2, 4, 8, 16, 32?","Q: Factorise '3x+36'","Q: Factorise 'x2 +4x-12’"] # Change this
x = rand.randint(0,4)
level_5_txt = tk.Label(canvas7, text="Level Five",font=("Times New Roman", 18),bg='spring green')
text_q = tk.Label(canvas7, text=q[x],font=("Helvetica", 18),bg='spring green')
A = [["A: Planned economy","B: Mixed economy","C: Market economy","D: None of the above"],["A: True","B: False"],["A: Arithmetic", "B: Geometric", "C: Quadratic", "D: 1815"],["A: 3 x X x 36", "B: X+12", "C: No Thanks", "D: 3(x+12)"],["A: (x+2)(x-6)","B: 2(x-2)(x+6)","C: (x-2)(x+6)","D: 2(2x-6)"]] # Change this
AA = ["A","A","B","D","C"] # Change this to Level_5 options
text_q.place(x=100,y=90)
level_5_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)

lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25,command=lambda: level_6(x)).place(x = 200, y = 400)

else:
count_lvl[3] = count_lvl[3] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
print(count_lvl[3])

def level_4(s,length):
AA = ["A","B","D","C","A"] # Change this to Level_3 options
global count_lvl
lbl = tk.Label(canvas6, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25, command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame5.pack_forget()
frame6.pack()
canvas6.pack()

q = ["Q: What is the specific heat capacity of water?","Q: What year was the first moon landing?","Q: George Orwell wrote 'Animal Farm'","Q: How many bones does the human body have?","Q: Where was the first paper book written?"]
x = rand.randint(0,4)
level_4_txt = tk.Label(canvas6, text="Level Four",font=("Times New Roman", 18),bg='azure')
text_q = tk.Label(canvas6, text=q[x],font=("Helvetica", 18),bg='azure')
A = [["A: 420J","B: 4200kJ","C: 4200J","D: 4100J"],["A: 1968","B: 1969", "C: 1970", "D: 1971"],["A: True", "B: False"],["A: 187", "B: 209", "C: 306", "D: 206"],["A: Russia","B: Britain","C: China","D: Austria"]]
AA = ["C","B","A","D","C"] # Change this to Level_4 options
text_q.place(x=100,y=90)
level_4_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)

lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25,command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[2] = count_lvl[2] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
print(count_lvl[2])

def level_3(s):
AA = ["D","B","C","B","A"] # Change this to Level_2 options
global count_lvl
lbl = tk.Label(canvas5, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25, command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame4.pack_forget()
frame5.pack()
canvas5.pack()

q = ["Q: Who killed Archduke Franz Ferdinand?","Q: What is 4/9 to the power of -1/2?","Q: What is an exothermic reaction?","Q: What is an endothermic reaction?","Q: How many centimetres in a kilometre?"] # Change this
x = rand.randint(0,4)
level_3_txt = tk.Label(canvas5, text="Level Three",font=("Times New Roman", 18),bg='coral')
text_q = tk.Label(canvas5, text=q[x],font=("Helvetica", 18),bg='coral')
A = [["A: Gavrilo Princip","B: Gavilipo Princip","C: Gavrilip Princep","D: Gavip Prince"],["A: 2/3","B: 3/2", "C: -2/3", "D: 5/6"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbment of heat energy", "D: Expulsion of heat energy"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbing heat energy", "D: Expelling heat energy"],["A: 100,000cm","B: 10,000cm","C: 1,000,000cm","D: 10,000,000cm"]] # Change this
AA = ["A","B","D","C","A"] # Change this to Level_3 options
text_q.place(x=100,y=90)
level_3_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas5, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=300)

lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25,command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[1] = count_lvl[1] + 1
r1 = tk.Radiobutton(canvas5, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text="").place(x=100,y=300)
print(count_lvl[1])

def level_2(s):
global count_lvl
AA = ["A","B","D","A","B"] # Level_1 options
lbl = tk.Label(canvas4, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25, command=lambda: level_3(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame3.pack_forget()
frame4.pack()
canvas4.pack()

q = ["Q: What was Russia called after the Russian Empire?","Q: Who painted the Mona Lisa?","Q: When was the first tank used?","Q: What is the fear of spiders called?","Q: Who was the Prime Minister of Britain during WW2?"]
x = rand.randint(0,4)
level_2_txt = tk.Label(canvas4, text="Level Two",font=("Times New Roman", 18),bg='sky blue')
text_q = tk.Label(canvas4, text=q[x],font=("Helvetica", 18),bg='sky blue')
A = [["A: Russia","B: Russian Federation","C: Socialist Russia","D: USSR"],["A: Leonardo Da Caprio","B: Leonardo Da Vinci", "C: Leonardo Da Vinki", "D: Leonardo De Vinki"],["A: 1916", "B: 1914", "C: 1915", "D: 1815"],["A: Afraid-Of-Spiders-Phobia", "B: Arachnophobia", "C: No-Like-Spiders", "D: Arachnatoidophobia"],["A: Winston Churchhill","B: Winston Church","C: Neville Chaimberlain","D: Neville Churchhill"]]
AA = ["D","B","C","B","A"] # Level_2 options
text_q.place(x=100,y=90)
level_2_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas4, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=300)

lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,command=lambda: level_3(x)).place(x = 200, y = 400)

else:
count_lvl[0] = count_lvl[0] + 1
r1 = tk.Radiobutton(canvas4, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text="").place(x=100,y=300)
print(count_lvl[0])

def load_level_1():
frame2.pack_forget()
frame3.pack()
canvas3.pack()
q = ["Q: What is the square root of 64 plus the square root of 49?","Q: Can energy be created or destroyed?","Q: What is the gradient of a line on a graph?","Q: What is a cell?","Q: What equation is linked to the Pythagorean Theorem?"]
x = rand.randint(0,4)
level_1_txt = tk.Label(canvas3, text="Level One",font=("Times New Roman", 18),bg='cyan')
text_q = tk.Label(canvas3, text=q[x],font=("Helvetica", 18),bg='cyan')
A = [["A: 15","B: 13","C: 14","D: 16"],["A: Yes","B: No"],["A: The slide", "B: The height", "C: The length", "D: The slope"],["A: A microorganism that provides structure", "B: A prison cell", "C: A cell phone", "D: None of the above"],["A: A squared minus B squared equals C squared ","B: A squared plus B squared equals C squared","C: A squared times B squared equals C squared","D: A squared plus B squared equals C"]]
AA = ["A","B","D","A","B"]
text_q.place(x=100,y=90)
level_1_txt.place(x=0,y=0)
lbl = tk.Label(canvas3, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25, command=lambda: level_2(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (len(A[x]) == 4):
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas3, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas3, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=300)

else:
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)

# ----------------------- User Name input Window ------------------------------------------

lab1 = tk.Entry(canvas2, text = name_var,font=("Purisa",15)).place(x = 240,y = 120,width=410,height=70)
level_1 = tk.Button(canvas2,text="Next",font=("Purisa",20),width=25,command=load_level_1).place(x = 240, y = 200)

# ----------------------- Main Window ------------------------------------------

canvas1.create_text(120,70,anchor=tk.W,font=("Purisa",50),fill="black",text="Knowledge Masters")
ToMap = tk.Button(canvas1,text="Start",font=("Purisa",20),width=25,command=show_frame_2)
ToMap.place(x = 200, y = 150)
Quit = tk.Button(canvas1,text="Quit",font=("Purisa",20),width=25,command=quit)
Quit.place(x = 200, y = 210)
canvas2.create_text(270,70,anchor=tk.W,font=("Purisa",30),fill="black",text="Input the User name")

# ----------------------- Level-one Window ------------------------------------------

I feel old when other people I think of as my age say they’re drinking coffee.

Jar Wattinree wrote:I feel old when other people I think of as my age say they’re drinking coffee.

Me too. I am at an age where drinking coffee is justifiable and actually common, but for some reason I don't drink coffee at all.

Jar Wattinree wrote:I feel old when other people I think of as my age say they’re drinking coffee.

I feel old when I look at the Roblox updates.

Extra! Extra! Here are the news from Repitilysia!

SIKE! Haha, bamboozled you! These aren't the news, these are the olds!

Almanty, Jar Wattinree, Kathol Rift, Bunnies, and 3 othersWubdich, Daeltheria, and New ropakstadt

Repitilysia wrote:Extra! Extra! Here are the news from Repitilysia!
SIKE! Haha, bamboozled you! These aren't the news, these are the olds!

We have been fooled once again by the superior Snek.

Repitilysia, Jar Wattinree, and Bunnies

Jar Wattinree wrote:I feel old when other people I think of as my age say they’re drinking coffee.

How?

Arthralonia wrote:Honestly though, I think the condemnation makes the region look cooler.

An opinion held by the previous government as well

I think condemnations used to be worse though. Not like gameplay wise but like socially

Bunnies wrote:An opinion held by the previous government as well

I think condemnations used to be worse though. Not like gameplay wise but like socially

Condemnation mean shiny badge. That works for me.

Bunnies

Jar Wattinree wrote:I feel old when other people I think of as my age say they’re drinking coffee.

In your defense you are an adult.

Bunnies

True Europa State wrote:Hello my fellow people. How do you do?

More importantly, guess what time it is? You guessed correctly, its code update time! Another update so yall can see how useful my time has been

import tkinter as tk
import random as rand
from time import time

t_start = time()
window = tk.Tk()
window.geometry("800x500")

var = tk.StringVar()
name_var = tk.StringVar()
name = name_var.get()

frame1 = tk.Frame(window, width=800, height=500)
frame1.pack()
frame2 = tk.Frame(window, width=800, height=500)
frame2.pack_forget()
frame3 = tk.Frame(window, width=800, height=500)
frame3.pack_forget()
frame4 = tk.Frame(window, width=800, height=500)
frame4.pack_forget()
frame5 = tk.Frame(window, width=800, height=500)
frame5.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame7 = tk.Frame(window, width=800, height=500)
frame7.pack_forget()
frame8 = tk.Frame(window, width=800, height=500)
frame8.pack_forget()
frame9 = tk.Frame(window, width=800, height=500)
frame9.pack_forget()

canvas1 = tk.Canvas(frame1,width=800,height=500,bg='cyan')
canvas1.pack()
canvas2 = tk.Canvas(frame2,width=800,height=500,bg='cyan')
canvas2.pack_forget()
canvas3 = tk.Canvas(frame3,width=800,height=500,bg='cyan')
canvas3.pack_forget()
canvas4 = tk.Canvas(frame4,width=800,height=500,bg='sky blue')
canvas4.pack_forget()
canvas5 = tk.Canvas(frame5,width=800,height=500,bg='coral')
canvas5.pack_forget()
canvas6 = tk.Canvas(frame6,width=800,height=500,bg='azure')
canvas6.pack_forget()
canvas7 = tk.Canvas(frame7,width=800,height=500,bg='spring green')
canvas7.pack_forget()
canvas8 = tk.Canvas(frame8,width=800,height=500,bg='gold')
canvas8.pack_forget()
canvas9 = tk.Canvas(frame9,width=800,height=500,bg='purple')
canvas9.pack_forget()

lbl = tk.Label(window, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
count_lvl = [0,0,0,0,0,0]

def show_frame_2():
frame1.pack_forget()
frame2.pack()
canvas2.pack()

def finish(s):
AA = ["A","A","A","A","A"] # Change this to Level_6 options
global count_lvl

if(AA[s] == var.get()):
frame8.pack_forget()
frame9.pack()
canvas9.pack()
t_end = time()
elapsed_time = t_end - t_start
text_q = tk.Label(canvas9, text="Game Finished \n Time taken "+ str(round(elapsed_time,1)) + " Seconds",font=("Helvetica", 30),bg='purple',fg='yellow')
text_q.place(relx = 0.5,
rely = 0.5,anchor = 'center')
print(name)
else:
count_lvl[5] = count_lvl[5] + 1
print(count_lvl[5])

def level_6(s):
AA = ["A","A","B","D","C"] # Change this to Level_5 options
global count_lvl
lbl = tk.Label(canvas8, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if(AA[s] == var.get()):
frame7.pack_forget()
frame8.pack()
canvas8.pack()

q = ["Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?"]
x = rand.randint(0,4)
level_6_txt = tk.Label(canvas8, text="Level Six",font=("Times New Roman", 18),bg='gold')
text_q = tk.Label(canvas8, text=q[x],font=("Helvetica", 18),bg='gold')
A = [["A: No","B: Yes","C: Yes","D: Yes"],["A: No","B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No","B: Yes","C: Yes","D: Yes"]]
AA = ["A","A","A","A","A"] # Change this to Level_6 options
text_q.place(x=100,y=90)
level_6_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas8, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=300)

lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)

else:
count_lvl[4] = count_lvl[4] + 1
r1 = tk.Radiobutton(canvas8, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text="").place(x=100,y=300)
print(count_lvl[4])

def level_5(s,length):
AA = ["C","B","A","D","C"] # Change this to Level_4 options
global count_lvl
lbl = tk.Label(canvas7, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25, command=lambda: level_6(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame6.pack_forget()
frame7.pack()
canvas7.pack()

q = ["Q: The USSR was following what type of economy?","Q: A market equilibrium is when the quantity demanded meets quantity supplied","Q: What type of sequence is '2, 4, 8, 16, 32?","Q: Factorise '3x+36'","Q: Factorise 'x2 +4x-12’"] # Change this
x = rand.randint(0,4)
level_5_txt = tk.Label(canvas7, text="Level Five",font=("Times New Roman", 18),bg='spring green')
text_q = tk.Label(canvas7, text=q[x],font=("Helvetica", 18),bg='spring green')
A = [["A: Planned economy","B: Mixed economy","C: Market economy","D: None of the above"],["A: True","B: False"],["A: Arithmetic", "B: Geometric", "C: Quadratic", "D: 1815"],["A: 3 x X x 36", "B: X+12", "C: No Thanks", "D: 3(x+12)"],["A: (x+2)(x-6)","B: 2(x-2)(x+6)","C: (x-2)(x+6)","D: 2(2x-6)"]] # Change this
AA = ["A","A","B","D","C"] # Change this to Level_5 options
text_q.place(x=100,y=90)
level_5_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)

lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25,command=lambda: level_6(x)).place(x = 200, y = 400)

else:
count_lvl[3] = count_lvl[3] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
print(count_lvl[3])

def level_4(s,length):
AA = ["A","B","D","C","A"] # Change this to Level_3 options
global count_lvl
lbl = tk.Label(canvas6, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25, command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame5.pack_forget()
frame6.pack()
canvas6.pack()

q = ["Q: What is the specific heat capacity of water?","Q: What year was the first moon landing?","Q: George Orwell wrote 'Animal Farm'","Q: How many bones does the human body have?","Q: Where was the first paper book written?"]
x = rand.randint(0,4)
level_4_txt = tk.Label(canvas6, text="Level Four",font=("Times New Roman", 18),bg='azure')
text_q = tk.Label(canvas6, text=q[x],font=("Helvetica", 18),bg='azure')
A = [["A: 420J","B: 4200kJ","C: 4200J","D: 4100J"],["A: 1968","B: 1969", "C: 1970", "D: 1971"],["A: True", "B: False"],["A: 187", "B: 209", "C: 306", "D: 206"],["A: Russia","B: Britain","C: China","D: Austria"]]
AA = ["C","B","A","D","C"] # Change this to Level_4 options
text_q.place(x=100,y=90)
level_4_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)

lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25,command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[2] = count_lvl[2] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
print(count_lvl[2])

def level_3(s):
AA = ["D","B","C","B","A"] # Change this to Level_2 options
global count_lvl
lbl = tk.Label(canvas5, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25, command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame4.pack_forget()
frame5.pack()
canvas5.pack()

q = ["Q: Who killed Archduke Franz Ferdinand?","Q: What is 4/9 to the power of -1/2?","Q: What is an exothermic reaction?","Q: What is an endothermic reaction?","Q: How many centimetres in a kilometre?"] # Change this
x = rand.randint(0,4)
level_3_txt = tk.Label(canvas5, text="Level Three",font=("Times New Roman", 18),bg='coral')
text_q = tk.Label(canvas5, text=q[x],font=("Helvetica", 18),bg='coral')
A = [["A: Gavrilo Princip","B: Gavilipo Princip","C: Gavrilip Princep","D: Gavip Prince"],["A: 2/3","B: 3/2", "C: -2/3", "D: 5/6"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbment of heat energy", "D: Expulsion of heat energy"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbing heat energy", "D: Expelling heat energy"],["A: 100,000cm","B: 10,000cm","C: 1,000,000cm","D: 10,000,000cm"]] # Change this
AA = ["A","B","D","C","A"] # Change this to Level_3 options
text_q.place(x=100,y=90)
level_3_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas5, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=300)

lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25,command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[1] = count_lvl[1] + 1
r1 = tk.Radiobutton(canvas5, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text="").place(x=100,y=300)
print(count_lvl[1])

def level_2(s):
global count_lvl
AA = ["A","B","D","A","B"] # Level_1 options
lbl = tk.Label(canvas4, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25, command=lambda: level_3(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame3.pack_forget()
frame4.pack()
canvas4.pack()

q = ["Q: What was Russia called after the Russian Empire?","Q: Who painted the Mona Lisa?","Q: When was the first tank used?","Q: What is the fear of spiders called?","Q: Who was the Prime Minister of Britain during WW2?"]
x = rand.randint(0,4)
level_2_txt = tk.Label(canvas4, text="Level Two",font=("Times New Roman", 18),bg='sky blue')
text_q = tk.Label(canvas4, text=q[x],font=("Helvetica", 18),bg='sky blue')
A = [["A: Russia","B: Russian Federation","C: Socialist Russia","D: USSR"],["A: Leonardo Da Caprio","B: Leonardo Da Vinci", "C: Leonardo Da Vinki", "D: Leonardo De Vinki"],["A: 1916", "B: 1914", "C: 1915", "D: 1815"],["A: Afraid-Of-Spiders-Phobia", "B: Arachnophobia", "C: No-Like-Spiders", "D: Arachnatoidophobia"],["A: Winston Churchhill","B: Winston Church","C: Neville Chaimberlain","D: Neville Churchhill"]]
AA = ["D","B","C","B","A"] # Level_2 options
text_q.place(x=100,y=90)
level_2_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas4, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=300)

lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,command=lambda: level_3(x)).place(x = 200, y = 400)

else:
count_lvl[0] = count_lvl[0] + 1
r1 = tk.Radiobutton(canvas4, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text="").place(x=100,y=300)
print(count_lvl[0])

def load_level_1():
frame2.pack_forget()
frame3.pack()
canvas3.pack()
q = ["Q: What is the square root of 64 plus the square root of 49?","Q: Can energy be created or destroyed?","Q: What is the gradient of a line on a graph?","Q: What is a cell?","Q: What equation is linked to the Pythagorean Theorem?"]
x = rand.randint(0,4)
level_1_txt = tk.Label(canvas3, text="Level One",font=("Times New Roman", 18),bg='cyan')
text_q = tk.Label(canvas3, text=q[x],font=("Helvetica", 18),bg='cyan')
A = [["A: 15","B: 13","C: 14","D: 16"],["A: Yes","B: No"],["A: The slide", "B: The height", "C: The length", "D: The slope"],["A: A microorganism that provides structure", "B: A prison cell", "C: A cell phone", "D: None of the above"],["A: A squared minus B squared equals C squared ","B: A squared plus B squared equals C squared","C: A squared times B squared equals C squared","D: A squared plus B squared equals C"]]
AA = ["A","B","D","A","B"]
text_q.place(x=100,y=90)
level_1_txt.place(x=0,y=0)
lbl = tk.Label(canvas3, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25, command=lambda: level_2(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (len(A[x]) == 4):
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas3, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas3, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=300)

else:
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)

# ----------------------- User Name input Window ------------------------------------------

lab1 = tk.Entry(canvas2, text = name_var,font=("Purisa",15)).place(x = 240,y = 120,width=410,height=70)
level_1 = tk.Button(canvas2,text="Next",font=("Purisa",20),width=25,command=load_level_1).place(x = 240, y = 200)

# ----------------------- Main Window ------------------------------------------

canvas1.create_text(120,70,anchor=tk.W,font=("Purisa",50),fill="black",text="Knowledge Masters")
ToMap = tk.Button(canvas1,text="Start",font=("Purisa",20),width=25,command=show_frame_2)
ToMap.place(x = 200, y = 150)
Quit = tk.Button(canvas1,text="Quit",font=("Purisa",20),width=25,command=quit)
Quit.place(x = 200, y = 210)
canvas2.create_text(270,70,anchor=tk.W,font=("Purisa",30),fill="black",text="Input the User name")

# ----------------------- Level-one Window ------------------------------------------

*scrolls through code*
*confused silence*

The Municipalities of Antarctica wrote:Do I?
Edit: Oh I do. Somehow.

Alrighty, lets see. Somu class comes in at around 140(insert measurement name thingy) And the Hatomaku class at around 170. Half of 140 is 70, so i need to find the 100 length mark. Whis is say little less than half of 70+70. so....

Rockemsockem wrote:*scrolls through code*
*confused silence*
Alrighty, lets see. Somu class comes in at around 140(insert measurement name thingy) And the Hatomaku class at around 170. Half of 140 is 70, so i need to find the 100 length mark. Whis is say little less than half of 70+70. so....

Supposed to be some quiz ame, not yet finished completely

Bunnies wrote:An opinion held by the previous government as well

I think condemnations used to be worse though. Not like gameplay wise but like socially

They tend to age into obscurity, since they tend to be a summary and not a paper with references and citations. The worse it is written the more of an obscurity it becomes.

New ropakstadt

True Europa State wrote:Hello my fellow people. How do you do?

More importantly, guess what time it is? You guessed correctly, its code update time! Another update so yall can see how useful my time has been

import tkinter as tk
import random as rand
from time import time

t_start = time()
window = tk.Tk()
window.geometry("800x500")

var = tk.StringVar()
name_var = tk.StringVar()
name = name_var.get()

frame1 = tk.Frame(window, width=800, height=500)
frame1.pack()
frame2 = tk.Frame(window, width=800, height=500)
frame2.pack_forget()
frame3 = tk.Frame(window, width=800, height=500)
frame3.pack_forget()
frame4 = tk.Frame(window, width=800, height=500)
frame4.pack_forget()
frame5 = tk.Frame(window, width=800, height=500)
frame5.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame6 = tk.Frame(window, width=800, height=500)
frame6.pack_forget()
frame7 = tk.Frame(window, width=800, height=500)
frame7.pack_forget()
frame8 = tk.Frame(window, width=800, height=500)
frame8.pack_forget()
frame9 = tk.Frame(window, width=800, height=500)
frame9.pack_forget()

canvas1 = tk.Canvas(frame1,width=800,height=500,bg='cyan')
canvas1.pack()
canvas2 = tk.Canvas(frame2,width=800,height=500,bg='cyan')
canvas2.pack_forget()
canvas3 = tk.Canvas(frame3,width=800,height=500,bg='cyan')
canvas3.pack_forget()
canvas4 = tk.Canvas(frame4,width=800,height=500,bg='sky blue')
canvas4.pack_forget()
canvas5 = tk.Canvas(frame5,width=800,height=500,bg='coral')
canvas5.pack_forget()
canvas6 = tk.Canvas(frame6,width=800,height=500,bg='azure')
canvas6.pack_forget()
canvas7 = tk.Canvas(frame7,width=800,height=500,bg='spring green')
canvas7.pack_forget()
canvas8 = tk.Canvas(frame8,width=800,height=500,bg='gold')
canvas8.pack_forget()
canvas9 = tk.Canvas(frame9,width=800,height=500,bg='purple')
canvas9.pack_forget()

lbl = tk.Label(window, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,state=tk.DISABLED).place(x = 200, y = 400)
count_lvl = [0,0,0,0,0,0]

def show_frame_2():
frame1.pack_forget()
frame2.pack()
canvas2.pack()

def finish(s):
AA = ["A","A","A","A","A"] # Change this to Level_6 options
global count_lvl

if(AA[s] == var.get()):
frame8.pack_forget()
frame9.pack()
canvas9.pack()
t_end = time()
elapsed_time = t_end - t_start
text_q = tk.Label(canvas9, text="Game Finished \n Time taken "+ str(round(elapsed_time,1)) + " Seconds",font=("Helvetica", 30),bg='purple',fg='yellow')
text_q.place(relx = 0.5,
rely = 0.5,anchor = 'center')
print(name)
else:
count_lvl[5] = count_lvl[5] + 1
print(count_lvl[5])

def level_6(s):
AA = ["A","A","B","D","C"] # Change this to Level_5 options
global count_lvl
lbl = tk.Label(canvas8, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if(AA[s] == var.get()):
frame7.pack_forget()
frame8.pack()
canvas8.pack()

q = ["Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?","Q: Is the Earth flat?"]
x = rand.randint(0,4)
level_6_txt = tk.Label(canvas8, text="Level Six",font=("Times New Roman", 18),bg='gold')
text_q = tk.Label(canvas8, text=q[x],font=("Helvetica", 18),bg='gold')
A = [["A: No","B: Yes","C: Yes","D: Yes"],["A: No","B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No", "B: Yes", "C: Yes", "D: Yes"],["A: No","B: Yes","C: Yes","D: Yes"]]
AA = ["A","A","A","A","A"] # Change this to Level_6 options
text_q.place(x=100,y=90)
level_6_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas8, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='gold', command=enable).place(x=100,y=300)

lvl6_btn = tk.Button(canvas8,text="Next",font=("Purisa",20),width=25, command=lambda: finish(x)).place(x = 200, y = 400)

else:
count_lvl[4] = count_lvl[4] + 1
r1 = tk.Radiobutton(canvas8, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas8, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas8, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas8, text="").place(x=100,y=300)
print(count_lvl[4])

def level_5(s,length):
AA = ["C","B","A","D","C"] # Change this to Level_4 options
global count_lvl
lbl = tk.Label(canvas7, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25, command=lambda: level_6(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame6.pack_forget()
frame7.pack()
canvas7.pack()

q = ["Q: The USSR was following what type of economy?","Q: A market equilibrium is when the quantity demanded meets quantity supplied","Q: What type of sequence is '2, 4, 8, 16, 32?","Q: Factorise '3x+36'","Q: Factorise 'x2 +4x-12’"] # Change this
x = rand.randint(0,4)
level_5_txt = tk.Label(canvas7, text="Level Five",font=("Times New Roman", 18),bg='spring green')
text_q = tk.Label(canvas7, text=q[x],font=("Helvetica", 18),bg='spring green')
A = [["A: Planned economy","B: Mixed economy","C: Market economy","D: None of the above"],["A: True","B: False"],["A: Arithmetic", "B: Geometric", "C: Quadratic", "D: 1815"],["A: 3 x X x 36", "B: X+12", "C: No Thanks", "D: 3(x+12)"],["A: (x+2)(x-6)","B: 2(x-2)(x+6)","C: (x-2)(x+6)","D: 2(2x-6)"]] # Change this
AA = ["A","A","B","D","C"] # Change this to Level_5 options
text_q.place(x=100,y=90)
level_5_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='spring green', command=enable).place(x=100,y=200)

lvl5_btn = tk.Button(canvas7,text="Next",font=("Purisa",20),width=25,command=lambda: level_6(x)).place(x = 200, y = 400)

else:
count_lvl[3] = count_lvl[3] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas7, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas7, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas7, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas7, text="").place(x=100,y=200)
print(count_lvl[3])

def level_4(s,length):
AA = ["A","B","D","C","A"] # Change this to Level_3 options
global count_lvl
lbl = tk.Label(canvas6, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25, command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame5.pack_forget()
frame6.pack()
canvas6.pack()

q = ["Q: What is the specific heat capacity of water?","Q: What year was the first moon landing?","Q: George Orwell wrote 'Animal Farm'","Q: How many bones does the human body have?","Q: Where was the first paper book written?"]
x = rand.randint(0,4)
level_4_txt = tk.Label(canvas6, text="Level Four",font=("Times New Roman", 18),bg='azure')
text_q = tk.Label(canvas6, text=q[x],font=("Helvetica", 18),bg='azure')
A = [["A: 420J","B: 4200kJ","C: 4200J","D: 4100J"],["A: 1968","B: 1969", "C: 1970", "D: 1971"],["A: True", "B: False"],["A: 187", "B: 209", "C: 306", "D: 206"],["A: Russia","B: Britain","C: China","D: Austria"]]
AA = ["C","B","A","D","C"] # Change this to Level_4 options
text_q.place(x=100,y=90)
level_4_txt.place(x=0,y=0)

if(len(A[x]) == 4):
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='azure', command=enable).place(x=100,y=200)

lvl4_btn = tk.Button(canvas6,text="Next",font=("Purisa",20),width=25,command=lambda: level_5(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[2] = count_lvl[2] + 1
if(length == 4):
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas6, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas6, text="").place(x=100,y=300)
else:
r1 = tk.Radiobutton(canvas6, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas6, text="").place(x=100,y=200)
print(count_lvl[2])

def level_3(s):
AA = ["D","B","C","B","A"] # Change this to Level_2 options
global count_lvl
lbl = tk.Label(canvas5, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25, command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame4.pack_forget()
frame5.pack()
canvas5.pack()

q = ["Q: Who killed Archduke Franz Ferdinand?","Q: What is 4/9 to the power of -1/2?","Q: What is an exothermic reaction?","Q: What is an endothermic reaction?","Q: How many centimetres in a kilometre?"] # Change this
x = rand.randint(0,4)
level_3_txt = tk.Label(canvas5, text="Level Three",font=("Times New Roman", 18),bg='coral')
text_q = tk.Label(canvas5, text=q[x],font=("Helvetica", 18),bg='coral')
A = [["A: Gavrilo Princip","B: Gavilipo Princip","C: Gavrilip Princep","D: Gavip Prince"],["A: 2/3","B: 3/2", "C: -2/3", "D: 5/6"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbment of heat energy", "D: Expulsion of heat energy"],["A: Destroying heat energy", "B: Creating heat energy", "C: Absorbing heat energy", "D: Expelling heat energy"],["A: 100,000cm","B: 10,000cm","C: 1,000,000cm","D: 10,000,000cm"]] # Change this
AA = ["A","B","D","C","A"] # Change this to Level_3 options
text_q.place(x=100,y=90)
level_3_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas5, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='coral', command=enable).place(x=100,y=300)

lvl3_btn = tk.Button(canvas5,text="Next",font=("Purisa",20),width=25,command=lambda: level_4(x,len(A[x]))).place(x = 200, y = 400)

else:
count_lvl[1] = count_lvl[1] + 1
r1 = tk.Radiobutton(canvas5, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas5, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas5, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas5, text="").place(x=100,y=300)
print(count_lvl[1])

def level_2(s):
global count_lvl
AA = ["A","B","D","A","B"] # Level_1 options
lbl = tk.Label(canvas4, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25, command=lambda: level_3(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (AA[s] == var.get()):
frame3.pack_forget()
frame4.pack()
canvas4.pack()

q = ["Q: What was Russia called after the Russian Empire?","Q: Who painted the Mona Lisa?","Q: When was the first tank used?","Q: What is the fear of spiders called?","Q: Who was the Prime Minister of Britain during WW2?"]
x = rand.randint(0,4)
level_2_txt = tk.Label(canvas4, text="Level Two",font=("Times New Roman", 18),bg='sky blue')
text_q = tk.Label(canvas4, text=q[x],font=("Helvetica", 18),bg='sky blue')
A = [["A: Russia","B: Russian Federation","C: Socialist Russia","D: USSR"],["A: Leonardo Da Caprio","B: Leonardo Da Vinci", "C: Leonardo Da Vinki", "D: Leonardo De Vinki"],["A: 1916", "B: 1914", "C: 1915", "D: 1815"],["A: Afraid-Of-Spiders-Phobia", "B: Arachnophobia", "C: No-Like-Spiders", "D: Arachnatoidophobia"],["A: Winston Churchhill","B: Winston Church","C: Neville Chaimberlain","D: Neville Churchhill"]]
AA = ["D","B","C","B","A"] # Level_2 options
text_q.place(x=100,y=90)
level_2_txt.place(x=0,y=0)

r1 = tk.Radiobutton(canvas4, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='sky blue', command=enable).place(x=100,y=300)

lvl2_btn = tk.Button(canvas4,text="Next",font=("Purisa",20),width=25,command=lambda: level_3(x)).place(x = 200, y = 400)

else:
count_lvl[0] = count_lvl[0] + 1
r1 = tk.Radiobutton(canvas4, text="").place(x=100,y=150)
r2 = tk.Radiobutton(canvas4, text="").place(x=100,y=200)
r3 = tk.Radiobutton(canvas4, text="").place(x=100,y=250)
r4 = tk.Radiobutton(canvas4, text="").place(x=100,y=300)
print(count_lvl[0])

def load_level_1():
frame2.pack_forget()
frame3.pack()
canvas3.pack()
q = ["Q: What is the square root of 64 plus the square root of 49?","Q: Can energy be created or destroyed?","Q: What is the gradient of a line on a graph?","Q: What is a cell?","Q: What equation is linked to the Pythagorean Theorem?"]
x = rand.randint(0,4)
level_1_txt = tk.Label(canvas3, text="Level One",font=("Times New Roman", 18),bg='cyan')
text_q = tk.Label(canvas3, text=q[x],font=("Helvetica", 18),bg='cyan')
A = [["A: 15","B: 13","C: 14","D: 16"],["A: Yes","B: No"],["A: The slide", "B: The height", "C: The length", "D: The slope"],["A: A microorganism that provides structure", "B: A prison cell", "C: A cell phone", "D: None of the above"],["A: A squared minus B squared equals C squared ","B: A squared plus B squared equals C squared","C: A squared times B squared equals C squared","D: A squared plus B squared equals C"]]
AA = ["A","B","D","A","B"]
text_q.place(x=100,y=90)
level_1_txt.place(x=0,y=0)
lbl = tk.Label(canvas3, bg='red', width=20, height=1,font=("Purisa",15),fg="yellow", relief="sunken", text='empty')
def enable():
if(var.get() == "A" or var.get() == "B" or var.get() == "C" or var.get() == "D"):
lvl1_btn = tk.Button(canvas3,text="Next",font=("Purisa",20),width=25, command=lambda: level_2(x)).place(x = 200, y = 400)
lbl.place(x=550,y=0)
lbl.config(text='You have selected ' + var.get())

if (len(A[x]) == 4):
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)
r3 = tk.Radiobutton(canvas3, text=A[x][2], variable=var, value='C', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=250)
r4 = tk.Radiobutton(canvas3, text=A[x][3], variable=var, value='D', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=300)

else:
r1 = tk.Radiobutton(canvas3, text=A[x][0], variable=var, value='A', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=150)
r2 = tk.Radiobutton(canvas3, text=A[x][1], variable=var, value='B', font=("Helvetica", 18),bg='cyan', command=enable).place(x=100,y=200)

# ----------------------- User Name input Window ------------------------------------------

lab1 = tk.Entry(canvas2, text = name_var,font=("Purisa",15)).place(x = 240,y = 120,width=410,height=70)
level_1 = tk.Button(canvas2,text="Next",font=("Purisa",20),width=25,command=load_level_1).place(x = 240, y = 200)

# ----------------------- Main Window ------------------------------------------

canvas1.create_text(120,70,anchor=tk.W,font=("Purisa",50),fill="black",text="Knowledge Masters")
ToMap = tk.Button(canvas1,text="Start",font=("Purisa",20),width=25,command=show_frame_2)
ToMap.place(x = 200, y = 150)
Quit = tk.Button(canvas1,text="Quit",font=("Purisa",20),width=25,command=quit)
Quit.place(x = 200, y = 210)
canvas2.create_text(270,70,anchor=tk.W,font=("Purisa",30),fill="black",text="Input the User name")

# ----------------------- Level-one Window ------------------------------------------

I didn't know you were a coding kind of person. Cool!

New ropakstadt wrote:I didn't know you were a coding kind of person. Cool!

Can I buy fish?

New ropakstadt wrote:I didn't know you were a coding kind of person. Cool!

I'm just starting off learning to code. This is for a project I have due on Thursday, and I have just a bit more of the code to complete, then I have to do this worksheet, then I'm done.

New ropakstadt

New ropakstadt

Calption wrote:Can I buy fish?

Yeah sure. I have more than I need

New ropakstadt wrote:Yeah sure. I have more than I need

Do you want to buy fruit?

New ropakstadt

Calption wrote:Do you want to buy fruit?

Fruittyyyyyyyy
Yes please

New ropakstadt wrote:Fruittyyyyyyyy
Yes please

How much fruit do you want to buy?

«12. . .29,38829,38929,39029,39129,39229,39329,394. . .44,43544,436»

Advertisement