File size: 1,207 Bytes
4f9cdf7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c43e4e0
4f9cdf7
 
 
 
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
30
31
32
33
34
35
36
import gradio as gr

# Initial values
COINS = 2710
MAX_BAG = 5800
MAX_BOX = 6800
CUR_BAG = 5400
CUR_BOX = 6800

def compute_days(coins, max_bag, max_box, cur_bag, cur_box):
    # Solve for days
    days = (max_bag + max_box - cur_bag - cur_box) / 50 * 4 
    days = days - (coins / 50)
    days_needed = int(days)
    
    return max(0, days_needed), max(0, days_needed * 50)

# Define the input components
coin_input = gr.inputs.Number(label="Number of Coins", default=COINS)
max_bag_input = gr.inputs.Number(label="MAX_BAG", default=MAX_BAG)
max_box_input = gr.inputs.Number(label="MAX_BOX", default=MAX_BOX)
cur_bag_input = gr.inputs.Number(label="CUR_BAG", default=CUR_BAG)
cur_box_input = gr.inputs.Number(label="CUR_BOX", default=CUR_BOX)

# Create the interface
iface = gr.Interface(
    fn=compute_days,
    inputs=[coin_input, max_bag_input, max_box_input, cur_bag_input, cur_box_input],
    outputs=[gr.outputs.Textbox(label="Days Needed"), gr.outputs.Textbox(label="Coins Needed")],
    title="Pokemon GO Calculator",
    description="Calculate the number of days needed to max out your Pokemon GO account - Here We Go!",
    theme='xiaobaiyuan/theme_brief',
)

# Run the interface
iface.launch()