Get up to 80 % extra points for free! More info:

Discussion: Creating a ScoreTracker

Activities
Avatar
Kaushik Rajarathinam:1/4/2018 22:46

I need help in making a score tracker that can add points if you win a game.

Code is below!

*The logo mini game doesn't show up well in this font"

import random
import time

time.sleep(2)
print("Presenting the...")
time.sleep(1)
print()
print()
print("_______ _________ _ _________ _______ _______ _______ _______ _______ ")
print("( )\__ __/( ( /|\__ __/( ____ \( ___ )( )( ____ \( ____ \ ")
print("| () () | ) ( | \ ( | ) ( | ( \/| ( ) || () () || ( \/| ( \/")
print("| || || | | | | \ | | | | | | | (___) || || || || (__ | (_____ ")
print("| |(_)| | | | | (\ \) | | | | | ____ | ___ || |(_)| || __) (_____ )")
print("| | | | | | | | \ | | | | | \_ )| ( ) || | | || ( ) |")
print("| ) ( |___) (___| ) \ |___) (___| (___) || ) ( || ) ( || (____/\/\____) |")
print("|/ \|\_______/|/ )_)\_______/(­_______)|/ \||/ \|(_______/\_­______)")
print()
time.sleep(1)
print("By Kaushik_pro")
time.sleep(1)
print()
print("(c) Copyright Upolies.Co")
print()
print()
print()
print("Type in your Name to begin!!")
myName = input()
print("Your Friends Name!")
myName2 = input()
print()
print()
print()

time.sleep(3)
print("* Starting")
print()
print("WELCOME TO MINIGAMES:")
time.sleep(0.1)
print(""+ myName +" and "+ myName2 +", you have a destiny to begin here. You both will play all the games. Is it possible ")
time.sleep(0.2)
print(" for you guys to win in all of the games? I don't think so.. Well, enjoy this game. I would")
time.sleep(0.3)
print(" love to see your reactions when you lose in the game!!")
print()
print()
time.sleep(5)
print("Instruc­tions:")
time.sleep(0.09)
print("Type in only numbers, in other cases letters. ")
time.sleep(0.07)
print(" If you do not type in a letter or number, the")
time.sleep(0.09)
print("game will crash. You will have to restart the")
time.sleep(0.09)
print(" whole game! Good Luck!!")
time.sleep(3)
print()
print("Type in any key to begin")
input()
print()

def displayIntro():
print('You are doing a trek to the Supersition mountains. You happen')
time.sleep(1)
print('to see two caves. In one the caves, the lost tresure of John')
time.sleep(1)
print(' Miller is hidden in on of the caves. People have tried to find it')
time.sleep(1)
print('and died. Hence it was called Supersition Mountains. And old ')
time.sleep(1)
print('tale says that the treasure changes places when your deciding. So')
time.sleep(1)
print('be careful...')

def chooseCave():
cave = ''
while cave != '1' and cave != '2':
print('Which cave will you go into? (1 or 2)')
cave = input()

return cave

def checkCave(cho­oseCave):
print('You approach the cave...')
time.sleep(2)
print('It is dark and spooky...')
time.sleep(2)
print('You see something glittering in the darkness...')
print()
time.sleep(2)

friendlyCave = random.randint(1, 2)

if chooseCave == str(friendlyCave):
print('You approach the glitteing thing and...')
time.sleep(3)
print("")

print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("*********­************************­************************­**********************")
print(" | | | |")
print(" _________|___­_____________­.=\"\"_;=.___________­___|____________________­_|_______")
print("| | ,-\"_,=\"\" `\"=.| |")
print("|________­___________|__\"=­._o`\"-._ `\"=.___________­___|___________________")
print(" | \"=._o\"=._ _`\"=._ |")
print(" _________|___­__________________:=­._o \"=._.\"_.-=\"'\"=.___________­_______|_______")
print("| | __.--\" , ; `\"=._o.\" ,-\"\"\"-._ \". |")
print("|________­___________|_­._\" ,. .` ` `` , `\"-._\"-._ \". '__|_________­__________")
print(" | |o\"=._ , \"` `; .\". , \"-._\"-._; ; |")
print(" _________|___­________| ;-.o\"=._; .\" ` '.\"\ . \"-._ /____________­___|_______")
print("| | |o; \"-.o\"=._` ' \" ,__.--o; |")
print("|________­___________|_| ; (#) -.o `\"=._.--\"_o.-; ;___|________­___________")
print("____/____­__/______/___|o;­._ \" `\".o|o_.--\" ;o;____/_____­_/______/____")
print("/______/_­_____/______/_\"=­._o--._ ; | ; ; ;/______/____­__/______/_")
print("____/____­__/______/______/__\"=­._o--._ ;o|o; _._;o;____/__­____/______/____")
print("/______/_­_____/______/______/____­\"=._o._; | ;_.--\"o.--\"_/______/__­____/______/_")
print("____/____­__/______/______/______/­_____\"=.o|o_.--\"\"___/_____­_/______/______/____")
print("/______/_­_____/______/______/____­__/______/______/______/­______/______/______/_")
print("*********­************************­************************­**********************")
print('You find John Miller\'s hidden treasue!!!')
time.sleep(1)
print('Great Job!! You are now famous and rich!!!')
time.sleep(2)
else:
print('You approach the glittering thing and...')
time.sleep(3)
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("MMMMMMMMM­MMMMMMMMMMMMMMMMMMMMMMM")
print("MMMMMMMMMMMM MMMMMMMMMMMM")
print("MMMMMMMMMM MMMMMMMMMM")
print("MMMMMMMMM MMMMMMMMM")
print("MMMMMMMM MMMMMMMM")
print("MMMMMMM MMMMMMMM")
print("MMMMMMM MMMMMMM")
print("MMMMMMM MMMMMMM")
print("MMMMMMM MMM MMM MMMMMMM")
print("MMMMMMM MMMMM MMMM MMMMMMM")
print("MMMMMMM MMMMM MMMM MMMMMMM")
print("MMMMMMMM MMMM M MMMM MMMMMMMM")
print("MMMMMMMM M MMMMMMM")
print("MMMMMMMM MMM MMMMMMMM")
print("MMMMMMMMMMMM MMM MMMMMMMMMMMM")
print("MMMMMMMMMM MM M MMMMMMMMM")
print("MMMMMMMMMM M M M M M MMMMMMMMMM")
print("MMMM MMMMM MMMMMMMMM MMMMM MM")
print("MMM MMMM M MMMMM M MMMM MM")
print("MMM MMMM M M M MMMMM MMM")
print("MMMM MMMM MMM MM")
print("MMM MMMM MMMM MM")
print("MMM MMMMMMMM M MMM")
print("MMMM MMM MMM MMMMMMMM")
print("MMMMMMMMMMM MM MMMMMMM M")
print("MMM MMMMMMM MMMMMMMMM M")
print("MM MMM MM M")
print("MM MMMM MM")
print("MMM MMMMMMMMMMMMM M")
print("MM MMMMMMMMMMMMMMMMMMM M")
print("MMM MMMMMMMMMMMMM­MMMMMMMMM M")
print("MMMMMMMMM­MMMMMMMMMMMMMMMMMMMMMMM")
print("YOU DIED")

def displayIntr():
print('You are in a land full of dragons. In front of you,')
time.sleep(1)
print('you see two caves. In one cave, the dragon is friendly')
time.sleep(1)
print(' and will share your treasure with you. The other Dragon')
time.sleep(1)
print('is greedy and hungry, and will eat you in sight.')
time.sleep(1)
print('People say that they sometimes change their caves, so be careful.')
print()

def chooseTunnel():
tunnel = ''
while tunnel != '5' and tunnel != '8':
print('Which cave will you go into? (5 or 8)')
tunnel = input()

return tunnel

def checkTunnel(cho­oseTunnel):
print('You approach the cave...')
time.sleep(2)
print('It is dark and spooky... (are you brave enough?)...')
time.sleep(2)
print('A big and fat dragon jumps out of the cave in front of you! He opens his jaws and...')
print()
time.sleep(2)

friendlyTunnel = random.randint(5, 8)

if chooseTunnel == str(friendlyTun­nel):
print('Gives you his treasure!')
print('')
print(":)")
time.sleep(1)
print('Nice, but now start to run, the other dragon is coming to eat you up!! -_-')
else:
print('Gobbles you down in one bite')
time.sleep(1)
print('This was your sad destiny... :(')

def drawboard(board):
print(' | |')
print(' ' + str(board[7]) + ' | ' +str( board[8]) + ' | ' + str(board[9]))
print(' | |')
print('-----------')
print(' | |')
print(' ' + str(board[4]) + ' | ' + str(board[5]) + ' | ' + str(board[6]))
print(' | |')
print('-----------')
print(' | |')
print(' ' + str(board[1]) + ' | ' + str(board[2]) + ' | ' + str(board[3]))
print(' | |')
def draw(board):
print(board[7], board[8], board[9])
print(board[4], board[5], board[6])
print(board[1], board[2], board[3])
print()
def t(board):
while True:
try:
x = int(input())
if x in board:
return x
else:
print("\nSpace already taken. Try again")
except ValueError:
print("\nThat's not a number. enter a space 1-9")
def GO(win,board):
for x, o, b in win:
if board[x] == board[o] == board[b]:
print("Player {0} wins!\n".format(bo­ard[x]))
print("Congra­tulations!\n")
return True
if 9 == sum
win = [(1, 2, 3),(4, 5, 6),(7, 8, 9),(1, 4, 7),(2, 5, 8),(3, 6, 9),(1, 5, 9),(3, 5, 7),]
for player in 'XO' * 9:
drawboard(board)
if GO(win,board):
break
print("Player {0}".format(pla­yer))
board[t(board)] = player
print()

playAgain = 'yes'
while playAgain == 'yes' or playAgain == 'y':

print(" Our First Game: John Miller's Treasure")
time.sleep(0.5)
print()
print("* "+ myName2 +"'s turn!")
print()
time.sleep(0.1)
print("* Game starting in 3 seconds!")
time.sleep(3)
print()
print()

displayIntro()

caveNumber = chooseCave()

checkCave(cave­Number)

time.sleep(3)
print("=========­======COMMERCI­AL BREAK==========­=====")
print("A Famous Quote:'"+ myName +" has no life..'")
print("=========­========================­=============")
print()
time.sleep(3)
print("Our next game is!!: Dragon's Treasure")
time.sleep(1)
print()
print("* "+ myName +"'s turn!")
time.sleep(0.2)
print()
print()
print("* Slightly the same as the first one..")
time.sleep(0.5)
print()
print()
print("* Game is starting in 5 seconds!")
time.sleep(5)

displayIntr()

tunnelNumber = chooseTunnel()

checkTunnel(tun­nelNumber)

time.sleep(3)

print("=========­======COMMERCI­AL BREAK==========­=====")
print("Did you know that "+ myName2 +" is so fat that when he/she was weighed, the weight was his/her phone number!")
print("=========­========================­=============")

guessesTaken = 0

print("")
print()
print("Our Next Game is: Guess the Number!")
print()
print("* "+ myName2 +"'s Turn!")
time.sleep(0.5)
print("* Game is Starting in 5 seconds!")
time.sleep(5)

guessesTaken = 0

number = random.randint(1, 20)
print('Hi '+ myName2 +' , I am thinking of a weird number between 1 and 20.')
time.sleep(1)
print('You may not win because you do not have brains!!')
time.sleep(1)
print('')
time.sleep(1)

while guessesTaken < 5:
print('Take a guess and you will lose.')
guess = input()
guess = int(guess)

guessesTaken = guessesTaken + 1

if guess < number:
print('Nope, your guess is really low. I am thinking of a weird number above that...')
print('')
if guess > number:
print('Nope, your guess is too high. I am thinking of a weird number below that...')
print('')
if guess == number:
break

if guess == number:
guessesTaken = str(guessesTaken)
print('Good Job!, ' + myName2 + '! You guessed my number in: ' + guessesTaken + ' guesses! You still suck though... :)')
print('')
time.sleep(1)
print('What is your comments about the game, stinky '+ myName2 +'')
print('')
time.sleep(1)
print('What is your number you want to be mostly used in the game?')
classs = input()
time.sleep(1)
print('Okay, I will use this number for guessing: ' + classs + '. ')
time.sleep(1)
print('')
print('Seeya around. If you wanna play again, loser...')
time.sleep(2)

if guess != number:
number = str(number)
print('Nope. The number I was thinking of was ' + number + '. Sorry... You just suck in playing this simple game. You could have done better... :( ')
print('')
print('What is your phone number?')
classs = input()
time.sleep(1)
print('Okay, I will use this number to call you: ' + classs + '. ')
time.sleep(1)
print('')
print('Seeya around. If you wanna play again, loser...')
time.sleep(2)
print()
print("* Sorry for a harsh game LOL.")
print()
print("=========­======COMMERCI­AL BREAK==========­=====")
time.sleep(2)
print("What is "+ myName +" famous for?")
time.sleep(2)
print("For getting an F in Math!")
print("=========­========================­=============")
print()
time.sleep(3)
print("Our Next Game is: Tic Tac Toe")
time.sleep(0.1)
print("")
print("* Two Player Game!")
time.sleep(1)
print()
print("* "+ myName +" is player X")
print("* "+ myName2 +" is player O")
time.sleep(1)
print()
print("Instruc­tions: ")
time.sleep(1)
print("Type a number ")
time.sleep(0.01)
print(" in the grid")
time.sleep(0.5)
print("to place your")
time.sleep(0.1)
print(" X or O in the")
time.sleep(0.1)
print("following boxes!")
print()
time.sleep(1)
print("* Game starting in",random.ran­dint(1, 10),"seconds!")
time.sleep(ran­dom.randint(1,10))
tic_tac_toe()
time.sleep(1)
print()
print("=========­======COMMERCI­AL BREAK==========­=====")
print("Did you know that "+ myName2 +" is so short that he/she was the last one to know that is was raining. ")
print("=========­========================­=============")
print()
print()
time.sleep(1)
print("Thanks for playing Minigames")
print("To Remove Commercial Jokes. Download the None Joke-Version")
print()
print('Do you want to play Minigames again? (yes or no)')
playAgain = input()

 
Reply
1/4/2018 22:46
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

1 messages from 1 displayed.