marcelhuber commited on
Commit
4f9cdf7
·
1 Parent(s): 86e011a

Add application file

Browse files
Files changed (2) hide show
  1. app.py +35 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Initial values
4
+ COINS = 2710
5
+ MAX_BAG = 5800
6
+ MAX_BOX = 6800
7
+ CUR_BAG = 5400
8
+ CUR_BOX = 6800
9
+
10
+ def compute_days(coins, max_bag, max_box, cur_bag, cur_box):
11
+ # Solve for days
12
+ days = (max_bag + max_box - cur_bag - cur_box) / 50 * 4
13
+ days = days - (coins / 50)
14
+ days_needed = int(days)
15
+
16
+ return max(0, days_needed), max(0, days_needed * 50)
17
+
18
+ # Define the input components
19
+ coin_input = gr.inputs.Number(label="Number of Coins", default=COINS)
20
+ max_bag_input = gr.inputs.Number(label="MAX_BAG", default=MAX_BAG)
21
+ max_box_input = gr.inputs.Number(label="MAX_BOX", default=MAX_BOX)
22
+ cur_bag_input = gr.inputs.Number(label="CUR_BAG", default=CUR_BAG)
23
+ cur_box_input = gr.inputs.Number(label="CUR_BOX", default=CUR_BOX)
24
+
25
+ # Create the interface
26
+ iface = gr.Interface(
27
+ fn=compute_days,
28
+ inputs=[coin_input, max_bag_input, max_box_input, cur_bag_input, cur_box_input],
29
+ outputs=[gr.outputs.Textbox(label="Days Needed"), gr.outputs.Textbox(label="Coins Needed")],
30
+ title="Pokemon GO Calculator",
31
+ description="Calculate the number of days needed to max out your Pokemon GO account - Here We Go!",
32
+ )
33
+
34
+ # Run the interface
35
+ iface.launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file may be used to create an environment using:
2
+ # $ conda create --name <env> --file <this file>
3
+ # platform: win-64
4
+