MEMORY GAME Program in Python
Program:
from time import sleep as slp
import random as rdm
name = input("Please enter you name")
name = name.title()
org = "DATA DEMONS"
game_name = 'MEMORY GAME'
won = "You won the level: "
out = "You lost the level: "
'''welcome = "* * * * * W E L C O M E * * * * *"
for i in welcome:
print(i, end = '')
slp(0.2)
print()
print("Hi!, ", end = '')
for j in name:
print(j, end = '')
slp(0.2)
print('. This is a ', end = '')
for k in game_name:
print(k, end = '')
slp(0.2)
print(', developed by ', end = '')
for k in org:
print(k, end = '')
slp(0.2)
print()
Rules = """RULES :-
1) No empty Enters.
2) Spellings must be correct and no extra spaces.
3) Not case sensitive.
5) Order must be correct.
4) Be genuine.
5) There will be 7 levels you can only choose one of it.
'Bot' - 3 Words, 5 Seconds.
'Noob' - 5 Words, 5 Seconds.
'Player' - 7 Words, 7 Seconds.
'Pro' - 10 Words, 7 Seconds
'Legend' - 13 Words, 10 Seconds.
'Ultra - 17 Words, 10 Seconds.
'Ultra Legend' - 20 Words, 12 Seconds."""
for l in Rules:
print(l, end = '')
slp(0.1)
print()'''
level = input("Enter you level name:")
level = level.title()
questions3 = ["Movie", "Cheese", "Cycle"]
questions5 = ["Movie", "Cheese", "Cycle", "Boy", "Game"]
questions7 = ["Movie", "Cheese", "Cycle", "Boy", "Game", "Mobile", "Ball"]
questions10 = ["Movie", "Cheese", "Cycle", "Boy", "Game", "Mobile", "Ball", "Plate", "Mountain", "Clock"]
questions13 = ["Movie", "Cheese", "Cycle", "Boy", "Game", "Mobile", "Ball", "Plate", "Mountain", "Clock", "Television", "Window", "Hair"]
questions17 = ["Movie", "Cheese", "Cycle", "Boy", "Game", "Mobile", "Ball", "Plate", "Mountain", "Clock", "Television", "Window", "Hair", "Blue", "Stadium", "Car", "God"]
questions20 = ["Movie", "Cheese", "Cycle", "Boy", "Game", "Mobile", "Ball", "Plate", "Mountain", "Clock", "Television", "Window", "Hair", "Blue", "Stadium", "Car", "God", "Exams", "Breath", "Books"]
if level == "Bot":
q = questions3.copy()
rdm.shuffle(q)
print(q)
slp(5)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for m in range(len(q)):
print(str(m + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for n in range(len(q)):
if a[n] == q[n]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Noob":
q = questions5.copy()
rdm.shuffle(q)
print(q)
slp(5)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Player":
q = questions7.copy()
rdm.shuffle(q)
print(q)
slp(7)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Pro":
q = questions10.copy()
rdm.shuffle(q)
print(q)
slp(7)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Legend":
q = questions13.copy()
rdm.shuffle(q)
print(q)
slp(10)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Ultra":
q = questions17.copy()
rdm.shuffle(q)
print(q)
slp(10)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
elif level == "Ultra Legend":
q = questions20.copy()
rdm.shuffle(q)
print(q)
slp(12)
for i in range(100):
print()
a = []
pos = 0
neg = 0
for r in range(len(q)):
print(str(r + 1) + 'th ', end = '')
inp = input("Word:")
inp = inp.title()
a.append(inp)
for s in range(len(q)):
if a[s] == q[s]:
pos += 1
else:
neg += 1
print(name, 'your answers are:', a, '\noriginal answers are:', q, '\nyou found', pos, 'correct and', neg, 'wrong')
if pos == len(q):
for o in won + level:
print(o, end = '')
slp(0.2)
print()
else:
for p in out + level:
print(p, end = '')
slp(0.2)
print()
Programmer details : Arun Meyyappan PL
Software used: Visual studio CODE
Version : 1.74
Documents and files download link
Python File(.py)
Text File(.txt)
0 Comments