tsu2000 commited on
Commit
25e0d20
1 Parent(s): b1f4347

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -9,6 +9,9 @@ ANIMATED_SNOW_PER_LIMB = 10
9
  ANIMATED_SNOW_SMASH_HEAD_TORSO = 10
10
  ANIMATED_SNOW_SMASH_PER_LIMB = 5
11
 
 
 
 
12
  # Define app UI
13
  app_ui = ui.page_fluid(
14
  ui.h1("☃️ Snow Golem Crafting Optimizer for MouseHunt (GWH 2023) ☃️"),
@@ -52,28 +55,28 @@ def server(input, output, session):
52
  def user_golem_heads():
53
  if input.golem_heads() is None:
54
  return
55
- return f"🙂 Head(s): {int(input.golem_heads()) if (input.golem_heads() >= 0 and input.golem_heads() <= 1000) else 'Invalid'}"
56
 
57
  @output
58
  @render.text
59
  def user_golem_torsos():
60
  if input.golem_torsos() is None:
61
  return
62
- return f"👕 Torso(s): {int(input.golem_torsos()) if (input.golem_torsos() >= 0 and input.golem_torsos() <= 1000) else 'Invalid'}"
63
 
64
  @output
65
  @render.text
66
  def user_golem_limbs():
67
  if input.golem_limbs() is None:
68
  return
69
- return f"🦵 Limb(s): {int(input.golem_limbs()) if (input.golem_limbs() >= 0 and input.golem_limbs() <= 1000) else 'Invalid'}"
70
 
71
  @output
72
  @render.text
73
  def user_ani_snow():
74
  if input.ani_snow() is None:
75
  return
76
- return f"❄️ Anim. Snow: {int(input.ani_snow()) if (input.ani_snow() >= 0 and input.ani_snow() <= 1000) else 'Invalid'}"
77
 
78
 
79
  # Perform the calculation for the maximum number of snow golems possible
 
9
  ANIMATED_SNOW_SMASH_HEAD_TORSO = 10
10
  ANIMATED_SNOW_SMASH_PER_LIMB = 5
11
 
12
+ # Maximum number of each resource that user can input
13
+ RESOURCE_CAP = 100000
14
+
15
  # Define app UI
16
  app_ui = ui.page_fluid(
17
  ui.h1("☃️ Snow Golem Crafting Optimizer for MouseHunt (GWH 2023) ☃️"),
 
55
  def user_golem_heads():
56
  if input.golem_heads() is None:
57
  return
58
+ return f"🙂 Head(s): {int(input.golem_heads()) if (input.golem_heads() >= 0 and input.golem_heads() <= RESOURCE_CAP) else 'Invalid'}"
59
 
60
  @output
61
  @render.text
62
  def user_golem_torsos():
63
  if input.golem_torsos() is None:
64
  return
65
+ return f"👕 Torso(s): {int(input.golem_torsos()) if (input.golem_torsos() >= 0 and input.golem_torsos() <= RESOURCE_CAP) else 'Invalid'}"
66
 
67
  @output
68
  @render.text
69
  def user_golem_limbs():
70
  if input.golem_limbs() is None:
71
  return
72
+ return f"🦵 Limb(s): {int(input.golem_limbs()) if (input.golem_limbs() >= 0 and input.golem_limbs() <= RESOURCE_CAP) else 'Invalid'}"
73
 
74
  @output
75
  @render.text
76
  def user_ani_snow():
77
  if input.ani_snow() is None:
78
  return
79
+ return f"❄️ Anim. Snow: {int(input.ani_snow()) if (input.ani_snow() >= 0 and input.ani_snow() <= RESOURCE_CAP) else 'Invalid'}"
80
 
81
 
82
  # Perform the calculation for the maximum number of snow golems possible