Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -85,36 +85,36 @@ st.slider('π§ Memory', 1, 10, 5),
|
|
85 |
st.slider('π₯ Roleplay', 1, 10, 5)]
|
86 |
|
87 |
if st.button('π Play'):
|
88 |
-
game_history_df = play_game(slider_values)
|
89 |
-
save_game_history(game_history_df)
|
90 |
|
91 |
if st.button('π² Run simulations'):
|
92 |
-
num_simulations = st.slider('π Number of simulations', 1, 100000, 1000)
|
93 |
-
run_simulations(num_simulations)
|
94 |
|
95 |
if st.button('π Show all game history'):
|
96 |
-
try:
|
97 |
-
game_history_df = pd.read_csv('game_history.csv')
|
98 |
-
st.write(game_history_df)
|
99 |
-
except:
|
100 |
-
st.write('No game history found')
|
101 |
|
102 |
if st.button('π Download game history'):
|
103 |
-
try:
|
104 |
-
game_history_df = pd.read_csv('game_history.csv')
|
105 |
-
filename = 'game_history_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
|
106 |
-
game_history_df.to_csv(filename, index=False)
|
107 |
-
st.write('π Game history downloaded!')
|
108 |
-
st.write(game_history_df)
|
109 |
-
except:
|
110 |
-
st.write('No game history found')
|
111 |
|
112 |
if st.button('π Download simulation results'):
|
113 |
-
try:
|
114 |
-
simulation_results_df = pd.read_csv('simulation_results.csv')
|
115 |
-
filename = 'simulation_results_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
|
116 |
-
simulation_results_df.to_csv(filename, index=False)
|
117 |
-
st.write('π Simulation results downloaded!')
|
118 |
-
st.write(simulation_results_df)
|
119 |
-
except:
|
120 |
-
st.write('No simulation results found')
|
|
|
85 |
st.slider('π₯ Roleplay', 1, 10, 5)]
|
86 |
|
87 |
if st.button('π Play'):
|
88 |
+
game_history_df = play_game(slider_values)
|
89 |
+
save_game_history(game_history_df)
|
90 |
|
91 |
if st.button('π² Run simulations'):
|
92 |
+
num_simulations = st.slider('π Number of simulations', 1, 100000, 1000)
|
93 |
+
run_simulations(num_simulations)
|
94 |
|
95 |
if st.button('π Show all game history'):
|
96 |
+
try:
|
97 |
+
game_history_df = pd.read_csv('game_history.csv')
|
98 |
+
st.write(game_history_df)
|
99 |
+
except:
|
100 |
+
st.write('No game history found')
|
101 |
|
102 |
if st.button('π Download game history'):
|
103 |
+
try:
|
104 |
+
game_history_df = pd.read_csv('game_history.csv')
|
105 |
+
filename = 'game_history_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
|
106 |
+
game_history_df.to_csv(filename, index=False)
|
107 |
+
st.write('π Game history downloaded!')
|
108 |
+
st.write(game_history_df)
|
109 |
+
except:
|
110 |
+
st.write('No game history found')
|
111 |
|
112 |
if st.button('π Download simulation results'):
|
113 |
+
try:
|
114 |
+
simulation_results_df = pd.read_csv('simulation_results.csv')
|
115 |
+
filename = 'simulation_results_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
|
116 |
+
simulation_results_df.to_csv(filename, index=False)
|
117 |
+
st.write('π Simulation results downloaded!')
|
118 |
+
st.write(simulation_results_df)
|
119 |
+
except:
|
120 |
+
st.write('No simulation results found')
|