Spaces:
Sleeping
Sleeping
Download app.py from duatanzeel/Arduino-Master: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/spaces/duatanzeel/Arduino-Master/resolve/main/app.py
- Command line
-
hf download hf://spaces/duatanzeel/Arduino-Master/app.py
-
curl -L -o app.py https://huggingface.co/spaces/duatanzeel/Arduino-Master/resolve/main/app.py
557 Bytes
| import streamlit as st | |
| import random | |
| st.set_page_config(page_title="Dice Roller", page_icon="π²") | |
| st.title("π² Dice Roller Game") | |
| st.write("Click the button to roll the dice!") | |
| if st.button("Roll Dice"): | |
| dice_value = random.randint(1, 6) | |
| st.success(f"You rolled a {dice_value}!") | |
| dice_faces = { | |
| 1: "β", | |
| 2: "β", | |
| 3: "β", | |
| 4: "β", | |
| 5: "β", | |
| 6: "β " | |
| } | |
| st.markdown(f"<h1 style='font-size:100px; text-align: center;'>{dice_faces[dice_value]}</h1>", unsafe_allow_html=True) | |