@HarshPancake/

TiesengaRPS.py

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#written by Troy Tiesenga
#Last modified 5/24/19
#This module simulates a game of rock paper scissors
import replit
#import replit allows me to clear shell. 
print('Please type Rock, Paper, or scissors in the shell.')
player1 = input('Player 1? ')
replit.clear()
print('Please type Rock, Paper, or scissors in the shell.')
player2 = input('Player 2? ')
replit.clear()

#making the user inputs lowercased
player1 = player1.lower()
player2 = player2.lower()
#If users do the same input
if player1 == player2:
  print('Tie!') 
#all outcomes
if player1 == 'rock':
  if player2 == 'paper':
    print('Player 2 wins!')  
  if player2 == 'scissors':
    print('player 1 wins!')
if player1 == 'paper':
  if player2 == 'rock':
    print('Player 1 wins!')
  if player2 == 'scissors':
    print('Player 2 wins!')
if player1 == 'scissors':
  if player2 == 'paper':
    print('Player 1 wins!')
  if player2 == 'rock':
    print('Player 2 wins!')
#all outcome