fineanmol / Hacktoberfest2024

Make your first Pull Request on Hacktoberfest 2024. Don't forget to spread love and if you like give us a ⭐️
https://fineanmol.github.io/Hacktoberfest2024/
GNU General Public License v3.0
1.86k stars 6.83k forks source link

Rock Paper Scissors using Python #6121

Open competitiveblood opened 11 months ago

competitiveblood commented 11 months ago

Is your feature request related to a problem? Please describe.

Dealing with elusive bugs, errors, and unexpected behavior in code which makes me mad :)

Describe the solution you'd like

Coping with frustrating, hard-to-find bugs in code can be stressful. Engaging in activities like playing a Python-based rock-paper-scissors game can provide a welcome break, relieve frustration, and even stimulate creative problem-solving, potentially leading to fresh insights when returning to bug-solving tasks.

Additional context

Incorporating short breaks and enjoyable activities, such as playing a Python rock-paper-scissors game, during intense debugging sessions can boost programmers' morale and prevent burnout. These breaks allow programmers to recharge mentally and return to the task with a clearer and refreshed perspective, often resulting in more effective bug-solving.

ShrishRajGupta commented 11 months ago

Hey @competitiveblood I would like to work on the issue.

Here is a proposed solution

from random import randint

#create a list of play options
t = ["Rock", "Paper", "Scissors"]

#assign a random play to the computer
computer = t[randint(0,2)]

#set player to False
player = False

while player == False:
#set player to True
    player = input("Rock, Paper, Scissors?")
    if player == computer:
        print("Tie!")
    elif player == "Rock":
        if computer == "Paper":
            print("You lose!", computer, "covers", player)
        else:
            print("You win!", player, "smashes", computer)
    elif player == "Paper":
        if computer == "Scissors":
            print("You lose!", computer, "cut", player)
        else:
            print("You win!", player, "covers", computer)
    elif player == "Scissors":
        if computer == "Rock":
            print("You lose...", computer, "smashes", player)
        else:
            print("You win!", player, "cut", computer)
    else:
        print("That's not a valid play. Check your spelling!")
    #player was set to True, but we want it to be False so the loop continues
    player = False
    computer = t[randint(0,2)]
competitiveblood commented 11 months ago

@ShrishRajGupta Looks good

pushkarcode commented 11 months ago

please assign to me...?

competitiveblood commented 11 months ago

@pushkarcode I have already put a PR for this issue

PranjalAsthana commented 11 months ago

Hey @competitiveblood I would like to work on this. Please assign me.

MahakGautam2002 commented 11 months ago

Hey i can write code for this issue. please assign it to me under hacktoberfest2023 tag.

VarunGithub9 commented 11 months ago

Hey i can write code for this issue. please assign it to me.

rishuraj1708 commented 11 months ago

Hey , will you please assign this to me .

policeakshithreddy commented 11 months ago

Can we develop any kind of app according to our specific requirements and preferences?

Rishi0510 commented 11 months ago

Hey @competitiveblood , it'd be great if you can please assign it to me.