Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,29 +1,23 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import random
|
| 3 |
|
| 4 |
-
|
| 5 |
-
st.set_page_config(page_title="π² Dice Roller Story Bot", page_icon="π²")
|
| 6 |
-
st.title("π² Dice Roller + Mini Story Bot")
|
| 7 |
-
st.markdown("Click the button to roll a dice and see what happens in your story!")
|
| 8 |
|
| 9 |
-
|
| 10 |
-
story_outcomes = {
|
| 11 |
-
1: "π§ You encountered a zombie and ran for your life!",
|
| 12 |
-
2: "π° You found a hidden treasure under a tree!",
|
| 13 |
-
3: "π A dragon appeared... but it just wanted a hug.",
|
| 14 |
-
4: "π‘οΈ You discovered an ancient shield with magical powers!",
|
| 15 |
-
5: "π You ate a glowing mushroom and now you can talk to animals.",
|
| 16 |
-
6: "π³οΈ You fell into a secret tunnel leading to a lost kingdom!"
|
| 17 |
-
}
|
| 18 |
|
| 19 |
-
|
| 20 |
-
if st.button("Roll the Dice π²"):
|
| 21 |
-
roll = random.randint(1, 6)
|
| 22 |
-
st.subheader(f"You rolled a **{roll}**!")
|
| 23 |
-
st.success(story_outcomes[roll])
|
| 24 |
-
else:
|
| 25 |
-
st.info("Ready to roll? Click the button above!")
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import random
|
| 3 |
|
| 4 |
+
st.set_page_config(page_title="Dice Roller", page_icon="π²")
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
st.title("π² Dice Roller Game")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
st.write("Click the button to roll the dice!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
if st.button("Roll Dice"):
|
| 11 |
+
dice_value = random.randint(1, 6)
|
| 12 |
+
st.success(f"You rolled a {dice_value}!")
|
| 13 |
+
|
| 14 |
+
dice_faces = {
|
| 15 |
+
1: "β",
|
| 16 |
+
2: "β",
|
| 17 |
+
3: "β",
|
| 18 |
+
4: "β",
|
| 19 |
+
5: "β",
|
| 20 |
+
6: "β
"
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
st.markdown(f"<h1 style='font-size:100px; text-align: center;'>{dice_faces[dice_value]}</h1>", unsafe_allow_html=True)
|