awacke1 commited on
Commit
c91c100
Β·
1 Parent(s): 8b1d587

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
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')