Skip to content

Instantly share code, notes, and snippets.

@MehediHasan25
Created October 4, 2018 09:26
Show Gist options
  • Select an option

  • Save MehediHasan25/fdcd8af8abc4e5326e6e32ee89f44277 to your computer and use it in GitHub Desktop.

Select an option

Save MehediHasan25/fdcd8af8abc4e5326e6e32ee89f44277 to your computer and use it in GitHub Desktop.
from os import system
import getpass
print("1.ROCK...")
print("2.PAPER...")
print("3.SCISSIOR...")
#player1 = input("player 1 , make your move : ")
#system("cls")
#player2 = input("player 2 , make your move : ")
player1 = str(getpass.getpass('player1 , Make your move : '))
player2 = str(getpass.getpass('player2 , Make your move : '))
if int(player1) > 0 and int(player1) <=3 and int(player2) > 0 and int(player2) <=3:
if player1 == player2:
print("It's a tie! ")
elif player1 == "1":
if player2 == "3":
print("player1 wins !")
elif player2 == "2":
print("player2 wins !")
elif player1 == "2":
if player2 == "1":
print("player1 wins !")
elif player2 == "3":
print("player2 wins !")
elif player1 == "3":
#print(player1)
if player2 == "2":
print("player1 wins !")
elif player2 == "1":
print("player2 wins !")
else:
print("Something went wrong")
else:
print("Wrong Input!!!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment