Spaces:
Sleeping
Sleeping
Update requirements.txt
Browse files- requirements.txt +1 -31
requirements.txt
CHANGED
|
@@ -1,31 +1 @@
|
|
| 1 |
-
|
| 2 |
-
import random
|
| 3 |
-
|
| 4 |
-
st.set_page_config(page_title="Rock Paper Scissors", page_icon="βοΈ")
|
| 5 |
-
|
| 6 |
-
st.title("πͺ¨πβοΈ Rock, Paper, Scissors Game")
|
| 7 |
-
|
| 8 |
-
choices = ['Rock', 'Paper', 'Scissors']
|
| 9 |
-
emojis = {'Rock': 'πͺ¨', 'Paper': 'π', 'Scissors': 'βοΈ'}
|
| 10 |
-
|
| 11 |
-
# Player choice
|
| 12 |
-
player_choice = st.selectbox("Choose your move:", choices)
|
| 13 |
-
|
| 14 |
-
# Play button
|
| 15 |
-
if st.button("Play"):
|
| 16 |
-
computer_choice = random.choice(choices)
|
| 17 |
-
|
| 18 |
-
st.write(f"**You chose:** {player_choice} {emojis[player_choice]}")
|
| 19 |
-
st.write(f"**Computer chose:** {computer_choice} {emojis[computer_choice]}")
|
| 20 |
-
|
| 21 |
-
# Game logic
|
| 22 |
-
if player_choice == computer_choice:
|
| 23 |
-
result = "It's a draw!"
|
| 24 |
-
elif (player_choice == 'Rock' and computer_choice == 'Scissors') or \
|
| 25 |
-
(player_choice == 'Scissors' and computer_choice == 'Paper') or \
|
| 26 |
-
(player_choice == 'Paper' and computer_choice == 'Rock'):
|
| 27 |
-
result = "π You win!"
|
| 28 |
-
else:
|
| 29 |
-
result = "π’ You lose!"
|
| 30 |
-
|
| 31 |
-
st.subheader(result)
|
|
|
|
| 1 |
+
streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|