File size: 764 Bytes
15b7f22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import random
import gradio as gr

def ladder_game(participants, outcomes):
    if len(participants) != len(outcomes):
        return "The number of participants must be equal to the number of outcomes."

    random.shuffle(outcomes)
    results = dict(zip(participants, outcomes))

    return results

def gradio_ladder_game():
    participants = ["Team 1", "Team 2", "Team 3", "Team 4"]
    outcomes = ["love", "robot", "storm", "death"]

    results = ladder_game(participants, outcomes)
    return results

iface = gr.Interface(
    fn=gradio_ladder_game,
    inputs=None,
    outputs="json",
    title="Drawing lots!🌱",
    description="Each team (Team 1, Team 2, Team 3, Team 4) will get one of the outcomes: love, robot, storm, death."
)

iface.launch()