Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,14 +44,15 @@ st.write("Choose your move:")
|
|
44 |
# Create three horizontal buttons
|
45 |
col1, col2, col3 = st.columns(3)
|
46 |
|
|
|
47 |
with col1:
|
48 |
-
if st.button("β"):
|
49 |
player_move = "Rock"
|
50 |
with col2:
|
51 |
-
if st.button("β"):
|
52 |
player_move = "Paper"
|
53 |
with col3:
|
54 |
-
if st.button("βοΈ"):
|
55 |
player_move = "Scissors"
|
56 |
|
57 |
# Ensure player_move is defined
|
@@ -92,10 +93,10 @@ if st.session_state.player_move:
|
|
92 |
col1, col2 = st.columns(2)
|
93 |
with col1:
|
94 |
st.write("Your move:")
|
95 |
-
st.subheader(player_move)
|
96 |
with col2:
|
97 |
st.write("Computer's move:")
|
98 |
-
st.subheader(computer_move)
|
99 |
|
100 |
# Display result
|
101 |
result = determine_winner(player_move, computer_move)
|
|
|
44 |
# Create three horizontal buttons
|
45 |
col1, col2, col3 = st.columns(3)
|
46 |
|
47 |
+
moveEmojis = {"Rock": "β", "Paper":"β", "Scissors": "βοΈ"}
|
48 |
with col1:
|
49 |
+
if st.button("Rock β"):
|
50 |
player_move = "Rock"
|
51 |
with col2:
|
52 |
+
if st.button("Paper β"):
|
53 |
player_move = "Paper"
|
54 |
with col3:
|
55 |
+
if st.button("ScissorsβοΈ"):
|
56 |
player_move = "Scissors"
|
57 |
|
58 |
# Ensure player_move is defined
|
|
|
93 |
col1, col2 = st.columns(2)
|
94 |
with col1:
|
95 |
st.write("Your move:")
|
96 |
+
st.subheader("{}: {}".format(player_move, moveEmojis[player_move]))
|
97 |
with col2:
|
98 |
st.write("Computer's move:")
|
99 |
+
st.subheader("{}: {}".format(computer_move, moveEmojis[computer_move]))
|
100 |
|
101 |
# Display result
|
102 |
result = determine_winner(player_move, computer_move)
|