Skill tree progression system & whitespace support

This commit is contained in:
2026-02-15 07:30:34 +00:00
parent 13550505c1
commit 6d6815af02
22 changed files with 2883 additions and 238 deletions

View File

@@ -7,8 +7,8 @@ pub fn compute_score(result: &DrillResult, complexity: f64) -> f64 {
(speed * complexity) / (errors + 1.0) * (length / 50.0)
}
pub fn compute_complexity(unlocked_count: usize) -> f64 {
(unlocked_count as f64 / 26.0).max(0.1)
pub fn compute_complexity(unlocked_count: usize, total_keys: usize) -> f64 {
(unlocked_count as f64 / total_keys as f64).max(0.1)
}
pub fn level_from_score(total_score: f64) -> u32 {
@@ -38,8 +38,8 @@ mod tests {
}
#[test]
fn test_complexity_scales_with_letters() {
assert!(compute_complexity(26) > compute_complexity(6));
assert!((compute_complexity(26) - 1.0).abs() < 0.001);
fn test_complexity_scales_with_keys() {
assert!(compute_complexity(96, 96) > compute_complexity(6, 96));
assert!((compute_complexity(96, 96) - 1.0).abs() < 0.001);
}
}