[Eva] Ева, прочитай .gitignore #35

Merged
Drobysh merged 1 commits from eva/chat-c3088d-backend into main 2026-10-13 11:34:18 +00:00
Showing only changes of commit 6e02303ea8 - Show all commits
+9 -13
View File
@@ -45,22 +45,18 @@ def grid_size_for(global_level: int) -> int:
return sizes[0] if pos <= HALF_WAVE else sizes[1]
def max_stars_for_wave() -> int:
"""Максимум звёзд за волну (10 уровней × 5 звёзд)."""
return WAVE_SIZE * 5
def max_points_for_wave() -> int:
"""Максимум очков за волну: 10 уровней × 110 = 1100."""
return 10 * 110
def wave_medal(stars_earned: int) -> str:
"""
Медаль волны по доле звёзд.
Пороги: gold >= 90%, silver >= 70%, bronze >= 50%, else 'none'.
"""
total = max_stars_for_wave()
pct = stars_earned / total if total > 0 else 0
if pct >= 0.90:
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
if pct >= 90:
return "gold"
if pct >= 0.70:
if pct >= 70:
return "silver"
if pct >= 0.50:
if pct >= 50:
return "bronze"
return "none"