Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def RockPrint():
- print("""
- ______ _
- | ___ \ | |
- | |_/ /___ ___| | __
- | // _ \ / __| |/ /
- | |\ \ (_) | (__| <
- \_| \_\___/ \___|_|\_\
- """)
- def PaperPrint():
- print("""
- ______
- | ___ \
- | |_/ /_ _ _ __ ___ _ __
- | __/ _` | '_ \ / _ \ '__|
- | | | (_| | |_) | __/ |
- \_| \__,_| .__/ \___|_|
- | |
- |_|
- """)
- def ScissorsPrint():
- print("""
- _____ _
- / ___| (_)
- \ `--. ___ _ ___ ___ ___ _ __ ___
- `--. \/ __| / __/ __|/ _ \| '__/ __|
- /\__/ / (__| \__ \__ \ (_) | | \__ \
- \____/ \___|_|___/___/\___/|_| |___/
- """)
- def Introduction():
- print("Welcome to Rock Paper Scissors.")
- sleep(2)
- print("This version of the game will try to beat you based on the answers that you have given over time.")
- sleep(2)
- print("To play, all you must do is type 'R', 'P' or 'S' to indicate your choice")
- sleep(2)
- print("Game starting in...")
- sleep(2)
- print("3")
- sleep(1)
- print("2")
- sleep(1)
- print("1")
- sleep(1)
- Main([1,5],[1,5],[1,5],0,0)
- def Main(RockRange,PaperRange,ScissorRange,CPUScore,PlayerScore):
- ChoiceName = ""
- while ChoiceName != "Rock" and ChoiceName != "Paper" and ChoiceName != "Scissors":
- UserInput = input("Enter your choice now, (R, P, or S)")
- if UserInput.upper() == "R":
- ChoiceName = "Rock"
- PaperRange[0] += 2
- PaperRange[1] += 2
- elif UserInput.upper() == "P":
- ChoiceName = "Paper"
- ScissorsRange[0] += 2
- ScissorsRange[1] += 2
- elif UserInput.upper() == "S":
- ChoiceName = "Scissors"
- RockRange[0] += 2
- RockRange[1] += 2
- else:
- print("You did not enter a valid choice, please try again")
- sleep(2)
- print("Hmmm... let me think")
- sleep(1)
- for i in range(3):
- print(".")
- sleep(1)
- results = WinCalculator(RockRange,PaperRange,ScissorRange)
- CPUChoice = results[0]
- RockRange = results[1]
- PaperRange = results[2]
- ScissorRange = results[3]
- print("I see your",ChoiceName,"and I raise you...")
- sleep(2)
- if CPUChoice == "Rock":
- if ChoiceName == "Paper":
- print("You win this round")
- PlayerScore += 1
- elif ChoiceName == "Scissors":
- print("I win this round")
- CPUScore += 1
- else:
- print("Draw")
- RockPrint()
- elif CPUChoice == "Paper":
- if ChoiceName == "Scissors":
- print("You win this round")
- PlayerScore += 1
- elif ChoiceName == "Rock":
- print("I win this round")
- CPUScore += 1
- else:
- print("Draw")
- PaperPrint()
- elif CPUChoice == "Scissors":
- if ChoiceName == "Rock":
- print("You win this round")
- PlayerScore += 1
- elif ChoiceName == "Paper":
- print("I win this round")
- CPUScore += 1
- else:
- print("Draw")
- ScissorsPrint()
- sleep(2)
- print("Current scores:")
- print("Player:",PlayerScore)
- print("CPU:",CPUScore)
- Main(RockRange,PaperRange,ScissorRange,CPUScore,PlayerScore)
- def WinCalculator(RockRange,PaperRange,ScissorRange):
- RockChance = randint(RockRange[0],RockRange[1])
- PaperChance = randint(PaperRange[0],PaperRange[1])
- ScissorChance = randint(ScissorRange[0],ScissorRange[1])
- CPUChoice = ""
- if RockChance > PaperChance and RockChance > ScissorChance:
- CPUChoice = "Rock"
- elif PaperChance > RockChance and PaperChance > ScissorChance:
- CPUChoice= "Paper"
- elif ScissorChance > RockChance and ScissorChance > PaperChance:
- CPUChoice = "Scissors"
- else:
- WinCalculator(RockRange,PaperRange,ScissorRange)
- return CPUChoice, RockRange, PaperRange, ScissorRange
- from time import sleep
- from random import randint
- Introduction()
Add Comment
Please, Sign In to add comment