Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #this is where the player will decide if they want to play against another player or against the computer.
- opponentchoice = input("Would you like to play against another player or against the computer? \n (Please type '1' for another player, '2' for the computer.")
- if opponentchoice == "1":
- player1_choice = input("Player 1, please choose. \n....Rock.... \n ....Paper.... \n ....Scissors...")
- print("****NO CHEATING**** \n" * 75)
- player2_choice = input("Player 2, please choose. \n....Rock.... \n ....Paper.... \n ....Scissors...")
- # if statements for if player1 wins
- if player1_choice == ("rock" or "Rock") and player2_choice == ("scissors" or "Scissors"):
- print("Player 1 wins with Rock!")
- elif player1_choice == ("scissors" or "Scissors") and player2_choice == ("paper" or "Paper"):
- print("Player 1 wins with Scissors!")
- elif player1_choice == ("paper" or "Paper") and player2_choice == ("rock" or "Rock"):
- print("Player 1 wins with Paper!")
- # if statements for if player2 wins
- if player2_choice == ("rock" or "Rock") and player1_choice == ("scissors" or "Scissors"):
- print("Player 2 wins with Rock!")
- elif player2_choice == ("scissors" or "Scissors") and player1_choice == ("paper" or "Paper"):
- print("Player 2 wins with scissors!")
- elif player2_choice == ("paper" or "Paper") and player1_choice == ("rock" or "Rock"):
- print("Player 2 wins with Paper!")
- # this is for if player1 and player2 input the same answer
- elif player1_choice == player2_choice:
- print("OMG WOW IT'S A DRAW THAT'S CRAZY TRY AGAIN")
- # with no thought into it, this should only print is if there is a draw and the capitolization isn't the same between answers
- #else:
- #print("IT'S A DRAW")
- else:
- player1_choice = input("Player 1, please choose. \n....Rock.... \n ....Paper.... \n ....Scissors...")
- # print("****NO CHEATING**** \n" * 75)
- # if statements for if player1 wins
- #This is where the pc choice is chosen
- pc_choice = random.randint(0,2)
- if pc_choice == 0:
- pc_answer = "Rock"
- elif pc_choice == 1:
- pc_answer = "Paper"
- else:
- pc_answer = "Scissors"
- print(f"The computer has played {pc_answer}!")
- if player1_choice == ("rock" or "Rock") and pc_answer == ("scissors" or "Scissors"):
- print("Player 1 wins with Rock!")
- elif player1_choice == ("scissors" or "Scissors") and pc_answer == ("paper" or "Paper"):
- print("Player 1 wins with Paper!")
- elif player1_choice == ("paper" or "Paper") and pc_answer == ("rock" or "Rock"):
- print("Player 1 wins with Paper!")
- #this is for if the pc wins
- if pc_answer == ("rock" or "Rock") and player1_choice == ("scissors" or "Scissors"):
- print("Computer wins with Rock!")
- elif pc_answer == ("scissors" or "Scissors") and player1_choice == ("paper" or "Paper"):
- print("Computer wins with Paper!")
- elif pc_answer == ("paper" or "Paper") and player1_choice == ("rock" or "Rock"):
- print("Computer wins with Paper!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement