Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
st.markdown("""
|
2 |
|
3 |
๐ฒ: This is the standard die used in many games, with each face showing a different number from 1 to 6.
|
@@ -20,17 +29,11 @@ st.markdown("""
|
|
20 |
""")
|
21 |
|
22 |
|
23 |
-
|
24 |
-
import streamlit as st
|
25 |
-
import pandas as pd
|
26 |
-
import random
|
27 |
-
import base64
|
28 |
-
|
29 |
# set up the game board
|
30 |
player_pos = {'Player 1': [0, 0], 'Player 2': [0, 0]}
|
31 |
board = pd.DataFrame(index=range(5), columns=range(5))
|
32 |
-
board.iloc[player_pos['Player 1'][0], player_pos['Player 1'][1]] = '
|
33 |
-
board.iloc[player_pos['Player 2'][0], player_pos['Player 2'][1]] = '
|
34 |
|
35 |
# implement the dice game
|
36 |
rolls = []
|
@@ -59,8 +62,8 @@ players = ['Player 1', 'Player 2']
|
|
59 |
player = st.selectbox('Select Player', players)
|
60 |
player_pos[player][1] = st.slider('Move Right or Left', -2, 2, 0)
|
61 |
player_pos[player][0] = st.slider('Move Up or Down', -2, 2, 0)
|
62 |
-
board.iloc[player_pos['Player 1'][0], player_pos['Player 1'][1]] = '
|
63 |
-
board.iloc[player_pos['Player 2'][0], player_pos['Player 2'][1]] = '
|
64 |
|
65 |
if st.button('Roll Dice'):
|
66 |
roll_dice(player)
|
@@ -71,4 +74,4 @@ if st.button('Roll Dice'):
|
|
71 |
st.write(board)
|
72 |
|
73 |
if st.button('Download Results'):
|
74 |
-
st.markdown(get_table_download_link(results, 'results'), unsafe_allow_html=True)
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
import streamlit as st
|
5 |
+
import pandas as pd
|
6 |
+
import random
|
7 |
+
import base64
|
8 |
+
|
9 |
+
|
10 |
st.markdown("""
|
11 |
|
12 |
๐ฒ: This is the standard die used in many games, with each face showing a different number from 1 to 6.
|
|
|
29 |
""")
|
30 |
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# set up the game board
|
33 |
player_pos = {'Player 1': [0, 0], 'Player 2': [0, 0]}
|
34 |
board = pd.DataFrame(index=range(5), columns=range(5))
|
35 |
+
board.iloc[player_pos['Player 1'][0], player_pos['Player 1'][1]] = '๐ด'
|
36 |
+
board.iloc[player_pos['Player 2'][0], player_pos['Player 2'][1]] = '๐ด'
|
37 |
|
38 |
# implement the dice game
|
39 |
rolls = []
|
|
|
62 |
player = st.selectbox('Select Player', players)
|
63 |
player_pos[player][1] = st.slider('Move Right or Left', -2, 2, 0)
|
64 |
player_pos[player][0] = st.slider('Move Up or Down', -2, 2, 0)
|
65 |
+
board.iloc[player_pos['Player 1'][0], player_pos['Player 1'][1]] = '๐ฎ'
|
66 |
+
board.iloc[player_pos['Player 2'][0], player_pos['Player 2'][1]] = '๐ฒ'
|
67 |
|
68 |
if st.button('Roll Dice'):
|
69 |
roll_dice(player)
|
|
|
74 |
st.write(board)
|
75 |
|
76 |
if st.button('Download Results'):
|
77 |
+
st.markdown(get_table_download_link(results, 'results'), unsafe_allow_html=True)
|