difficultyLevel static method
- double recentAccuracy
Determine difficulty adjustment based on recent accuracy.
-
85%: increase difficulty (too easy)
- 70-85%: maintain (in the zone)
- <70%: decrease difficulty (too hard)
Implementation
static DifficultyLevel difficultyLevel(double recentAccuracy) {
if (recentAccuracy > 0.85) return DifficultyLevel.harder;
if (recentAccuracy >= 0.70) return DifficultyLevel.maintain;
return DifficultyLevel.easier;
}