Spaces:
Sleeping
Sleeping
Update app.py
#1
by
alexmac93
- opened
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
|
4 |
-
def
|
5 |
-
return random.randint(
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
|
4 |
+
def roll_dice(sides):
|
5 |
+
return random.randint(1, sides)
|
6 |
|
7 |
+
gr.Interface(
|
8 |
+
fn=roll_dice,
|
9 |
+
inputs=gr.Slider(minimum=2, maximum=100, label="Number of Sides", step=1),
|
10 |
+
outputs="number",
|
11 |
+
title="Dice Roll Simulator",
|
12 |
+
description="Simulate a roll of a dice with a specified number of sides."
|
13 |
+
).launch()
|