Skip to content
View kenneth256's full-sized avatar
  • Uganda
  • 10:48 (UTC -12:00)

Block or report kenneth256

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
kenneth256/README.md

Skip to content Sign up Conradgabe / RPS Public Code Issues Pull requests Actions Projects Wiki Security Insights RPS/RockPaperScissor.py @Conradgabe Conradgabe RPS game 1 contributor 216 lines (187 sloc) 9.39 KB import random

choices = ['R', 'P', 'S']

computer = random.choice(choices)

print('This is a game of Rock Paper and Scissors****') print('\t\t\tThe rules are simple*') print('\t\tYou can Choose to Play Rock, Paper or Scissors*\n') print('\t*******Rule 1: If you choose to play Rock input "R" **') print('\tRule 2: If you choose to play Paper input "P" **') print('\tRule 3: If you choose to play Scissor input "S" *********\n') print('Note: To win ---------- Rock("R") beats Scissors("S")') print('\tTo win ---------- Scissors("S") beats Paper("P")') print('\tTo win ---------- Paper("P") beats Rock("R")')

########## Checking If the game wasa tie##########

while True: user_choice = input('What is you choice? ("R","P","S"): ')

if user_choice == "R":
    if computer == "R":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print("\t\t**********It's a tie**********")
        print("\t**********Do you want to continue playing? **********")

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

if user_choice == "S":
    if computer == "S":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print("\t\t**********It's a tie**********")
        print("\t**********Do you want to continue playing? **********")

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

if user_choice == "P":
    if computer == "P":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print("\t\t**********It's a tie**********")
        print("\t**********Do you want to continue playing? ************")

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

#########Checking whether the game was won#########

if user_choice == "R":
    if computer == "S":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('***************************You won!!!*****************************')

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

if user_choice == "S":
    if computer == "P":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('***************************You won!!!*****************************')
        
        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

if user_choice == "P":
    if computer == "R":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('***************************You won!!!*****************************')
        
        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

###########Checking to see if you lost###########

if user_choice == "P":
    if computer == "S":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('**************************You Lost ): ****************************')

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

if user_choice == "R":
    if computer == "P":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('**************************You Lost ): ****************************')

        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break
            

if user_choice == "S":
    if computer == "R":
        print(f"Player[{user_choice}] : Computer[{computer}]")
        print('**************************You Lost ): ****************************')
        
        chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
        if chance == 'Y':
            continue
        elif chance == "q":
            print('**********************GoodBye :)*******************')
            break
        else:
            print('********************Invalid Choice-----Choose Again**********************')
            chance = input("\t\t********Type 'Y' to continue and 'q' to quit***********:  ")
            if chance == 'Y':
                continue
            elif chance == "q":
                print('**********************GoodBye :)*******************')
                break

© 2022 GitHub, Inc. Terms Privacy Security Status Docs Contact GitHub Pricing API Train

Pinned Loading

  1. lovecalculator1 lovecalculator1 Public

    CSS