Merge pull request '[Eva] Ева, прочитай .gitignore' (#35) from eva/chat-c3088d-backend into main
Reviewed-on: #35
This commit was merged in pull request #35.
This commit is contained in:
+9
-13
@@ -45,22 +45,18 @@ def grid_size_for(global_level: int) -> int:
|
|||||||
return sizes[0] if pos <= HALF_WAVE else sizes[1]
|
return sizes[0] if pos <= HALF_WAVE else sizes[1]
|
||||||
|
|
||||||
|
|
||||||
def max_stars_for_wave() -> int:
|
def max_points_for_wave() -> int:
|
||||||
"""Максимум звёзд за волну (10 уровней × 5 звёзд)."""
|
"""Максимум очков за волну: 10 уровней × 110 = 1100."""
|
||||||
return WAVE_SIZE * 5
|
return 10 * 110
|
||||||
|
|
||||||
|
|
||||||
def wave_medal(stars_earned: int) -> str:
|
def wave_medal(points: int, max_points: int) -> str:
|
||||||
"""
|
"""Медаль за волну: gold ≥90%, silver ≥70%, bronze ≥50%, иначе none."""
|
||||||
Медаль волны по доле звёзд.
|
pct = 100 * points / max_points if max_points > 0 else 0
|
||||||
Пороги: gold >= 90%, silver >= 70%, bronze >= 50%, else 'none'.
|
if pct >= 90:
|
||||||
"""
|
|
||||||
total = max_stars_for_wave()
|
|
||||||
pct = stars_earned / total if total > 0 else 0
|
|
||||||
if pct >= 0.90:
|
|
||||||
return "gold"
|
return "gold"
|
||||||
if pct >= 0.70:
|
if pct >= 70:
|
||||||
return "silver"
|
return "silver"
|
||||||
if pct >= 0.50:
|
if pct >= 50:
|
||||||
return "bronze"
|
return "bronze"
|
||||||
return "none"
|
return "none"
|
||||||
|
|||||||
Reference in New Issue
Block a user