Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions BrowserHistory/rock_paper_scissors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
Rock, Paper, Scissors Game (CLI Version)
Author: Your Name
"""

import random


def get_user_choice():
"""Prompt the user to enter their choice."""
choice = input("Enter your choice (rock, paper, scissors): ").lower()
if choice in ["rock", "paper", "scissors"]:
return choice
else:
print("Invalid choice! Please enter rock, paper, or scissors.")
return get_user_choice()


def get_computer_choice():
"""Randomly select computer's choice."""
options = ["rock", "paper", "scissors"]
return random.choice(options)


def decide_winner(player, computer):
"""Decide the winner based on the choices."""
if player == computer:
return "It's a draw!"
elif (
(player == "rock" and computer == "scissors")
or (player == "paper" and computer == "rock")
or (player == "scissors" and computer == "paper")
):
return "You win!"
else:
return "Computer wins!"


def main():
"""Main function to play the game."""
user_choice = get_user_choice()
computer_choice = get_computer_choice()
print(f"Computer chose: {computer_choice}")
print(decide_winner(user_choice, computer_choice))


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion ImageDownloader/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==2.32.4
requests==2.32.5
4 changes: 2 additions & 2 deletions requirements_with_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Flask==3.1.1
selenium==4.35.0
firebase-admin==7.1.0
ujson==5.10.0
requests==2.32.4
requests==2.32.5
quo==2023.5.1
PyPDF2==3.0.1
pyserial==3.5
Expand Down Expand Up @@ -104,7 +104,7 @@ slab==1.8.2
psutil==7.0.0
mediapipe==0.10.21
rich==14.1.0
httplib2==0.22.0
httplib2==0.30.0
protobuf==6.31.1
colorama==0.4.6
plyer==2.1.0
Expand Down
52 changes: 0 additions & 52 deletions rock_paper_scissor_game.py

This file was deleted.

48 changes: 48 additions & 0 deletions rock_paper_scissors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
Rock, Paper, Scissors Game
Author: DEVANSH-GAJJAR
"""

import random


def get_user_choice():
"""Prompt the user to enter their choice."""
choice = input("Enter your choice (rock, paper, scissors): ").lower()
if choice in ["rock", "paper", "scissors"]:
return choice
else:
print("Invalid choice! Please enter rock, paper, or scissors.")
return get_user_choice()


def get_computer_choice():
"""Randomly select computer's choice."""
options = ["rock", "paper", "scissors"]
return random.choice(options)


def decide_winner(player, computer):
"""Decide the winner based on the choices."""
if player == computer:
return "It's a draw!"
elif (
(player == "rock" and computer == "scissors")
or (player == "paper" and computer == "rock")
or (player == "scissors" and computer == "paper")
):
return "You win!"
else:
return "Computer wins!"


def main():
"""Main function to play the game."""
user_choice = get_user_choice()
computer_choice = get_computer_choice()
print(f"Computer chose: {computer_choice}")
print(decide_winner(user_choice, computer_choice))


if __name__ == "__main__":
main()
Loading