umarabbas890 commited on
Commit
8a2df6b
·
verified ·
1 Parent(s): f0a47f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -25,4 +25,26 @@ def main():
25
  st.write(f"Computer chose: {computer_choice}")
26
 
27
  # Determine the winner
28
- if user_choice == computer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  st.write(f"Computer chose: {computer_choice}")
26
 
27
  # Determine the winner
28
+ if user_choice == computer_choice:
29
+ result = "It's a tie!"
30
+ elif (
31
+ (user_choice == "Rock" and computer_choice == "Scissors") or
32
+ (user_choice == "Paper" and computer_choice == "Rock") or
33
+ (user_choice == "Scissors" and computer_choice == "Paper")
34
+ ):
35
+ result = "You win!"
36
+ st.session_state.user_points += 1
37
+ else:
38
+ result = "You lose!"
39
+ st.session_state.computer_points += 1
40
+
41
+ # Display the result
42
+ st.write(result)
43
+
44
+ # Display the points
45
+ st.write(f"Your points: {st.session_state.user_points}")
46
+ st.write(f"Computer's points: {st.session_state.computer_points}")
47
+
48
+ # Run the app
49
+ if __name__ == "__main__":
50
+ main()