awacke1 commited on
Commit
c166997
Β·
verified Β·
1 Parent(s): 5afbcd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -17,6 +17,14 @@ REFRESH_RATE = 5
17
  INTERACTION_RADIUS = 2
18
  POINTS_PER_INTERACTION = 1
19
 
 
 
 
 
 
 
 
 
20
  # 🎨 Resource Management
21
  @st.cache_resource(show_spinner="Loading game resources...")
22
  def get_game_images():
@@ -26,20 +34,6 @@ def get_game_images():
26
  'other_player': Image.new('RGB', (50, 50), color='red')
27
  }
28
 
29
- # πŸ“ Name Generation
30
- @st.cache_data
31
- def get_name_components():
32
- return {
33
- 'prefixes': ['Aer', 'Bal', 'Cal', 'Dor', 'El', 'Fae', 'Gor', 'Hel', 'Il', 'Jor',
34
- 'Kal', 'Lyr', 'Mel', 'Nym', 'Oro', 'Pyr', 'Qar', 'Ryn', 'Syl', 'Tyr'],
35
- 'suffixes': ['ian', 'or', 'ion', 'us', 'ix', 'ar', 'en', 'yr', 'el', 'an',
36
- 'is', 'ax', 'on', 'ir', 'ex', 'az', 'er', 'eth', 'ys', 'ix']
37
- }
38
-
39
- def generate_fantasy_name():
40
- name_parts = get_name_components()
41
- return random.choice(name_parts['prefixes']) + random.choice(name_parts['suffixes'])
42
-
43
  # πŸ”„ Player Synchronization
44
  @st.cache_data(ttl=2)
45
  def load_all_players(timestamp):
 
17
  INTERACTION_RADIUS = 2
18
  POINTS_PER_INTERACTION = 1
19
 
20
+ # πŸ“ Name Generation - Independent function
21
+ def generate_fantasy_name():
22
+ prefixes = ['Aer', 'Bal', 'Cal', 'Dor', 'El', 'Fae', 'Gor', 'Hel', 'Il', 'Jor',
23
+ 'Kal', 'Lyr', 'Mel', 'Nym', 'Oro', 'Pyr', 'Qar', 'Ryn', 'Syl', 'Tyr']
24
+ suffixes = ['ian', 'or', 'ion', 'us', 'ix', 'ar', 'en', 'yr', 'el', 'an',
25
+ 'is', 'ax', 'on', 'ir', 'ex', 'az', 'er', 'eth', 'ys', 'ix']
26
+ return random.choice(prefixes) + random.choice(suffixes)
27
+
28
  # 🎨 Resource Management
29
  @st.cache_resource(show_spinner="Loading game resources...")
30
  def get_game_images():
 
34
  'other_player': Image.new('RGB', (50, 50), color='red')
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  # πŸ”„ Player Synchronization
38
  @st.cache_data(ttl=2)
39
  def load_all_players(timestamp):