import random
rps_ascii_art = '''
❤
█▀█ █▀█ █▀▀ █▄▀
█▀▄ █▄█ █▄▄ █░█
🅿 🅰 🅿 🅴 🆁 scissors
'''
print(rps_ascii_art)
def RPS():
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
rpsgameimages = [rock, paper, scissors]
outofrange = len(rpsgameimages)
computer_selection = random.randint(0, 2)
user_selection = int(
input('What do you select\n, press "0" for rock, press "1" for paper or press "2" for scissors'))
print(f"You selected {rpsgameimages[user_selection]}")
print(f"The AI computer selected {rpsgameimages[computer_selection]}")
if user_selection >= outofrange or user_selection < 0:
print("You typed an invalid selection, try again!")
elif user_selection == 0 and computer_selection == 1:
# rock verse paper
print("You lost against the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == 0 and computer_selection == 2:
# rock verse scissors
print("You beat the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == 1 and computer_selection == 0:
# paper verse rock
print("You beat the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == 1 and computer_selection == 2:
# paper verse scissors
print("You lost against the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == 2 and computer_selection == 0:
# scissors verse rock
print("You beat the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == 2 and computer_selection == 1:
# scissors verse paper
print("You beat the computer AI!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
elif user_selection == computer_selection:
print("You both tied each other! Good show and fun stuff!")
print('Do you want to restart? Type "Y" or "y" for yes or type "N" or "n" for no!')
response = input()
if response == "Y" or response == "y":
RPS()
elif response == "N" or response == "n":
print("Maybe next time?")
RPS()
input("Press any key to continue")
Instructions:
#Rules: # 0 = rock, 1 = paper, 2 = scissors
Rock Paper Scissors is a zero sum game that is usually played by two people using their hands and no tools.
The idea is to make shapes with an outstretched hand where each shape will have a certain degree of power and will lead to an outcome
# Rules: Rock wins against scissors. Scissors win against paper and Paper wins against rock.