Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,10 +15,12 @@ def roll_dice(num_rolls, dice_type):
|
|
15 |
|
16 |
def plot_tokens(health_tokens, coin_tokens):
|
17 |
fig = go.Figure()
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
22 |
fig.update_layout(title="Token Accumulation", xaxis_title="Rolls", yaxis_title="Tokens")
|
23 |
st.plotly_chart(fig)
|
24 |
|
|
|
15 |
|
16 |
def plot_tokens(health_tokens, coin_tokens):
|
17 |
fig = go.Figure()
|
18 |
+
if len(health_tokens) > 0:
|
19 |
+
health_foods = [FOOD_LIST[i] for i in health_tokens]
|
20 |
+
fig.add_trace(go.Scatter(x=list(range(1, len(health_foods) + 1)), y=health_foods, name="๐ Health"))
|
21 |
+
if len(coin_tokens) > 0:
|
22 |
+
coin_foods = [FOOD_LIST[i] for i in coin_tokens]
|
23 |
+
fig.add_trace(go.Scatter(x=list(range(1, len(coin_foods) + 1)), y=coin_foods, name="๐ฐ Coins"))
|
24 |
fig.update_layout(title="Token Accumulation", xaxis_title="Rolls", yaxis_title="Tokens")
|
25 |
st.plotly_chart(fig)
|
26 |
|