feat(server): expand daily challenge to 6 goal variants

Adds three new challenge types (win in 3 min, score ≥5000, win in 8 min)
so the daily challenge rotates through a fortnight of variety before any
variant repeats. Seeds are still deterministic worldwide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 03:05:18 +00:00
parent 0a76c089d0
commit cacacb00dc
+23 -2
View File
@@ -34,8 +34,8 @@ pub fn hash_date_to_u64(date: &str) -> u64 {
/// so all players face exactly the same challenge on the same day. /// so all players face exactly the same challenge on the same day.
fn generate_goal(date: &str, seed: u64) -> ChallengeGoal { fn generate_goal(date: &str, seed: u64) -> ChallengeGoal {
// Pick a goal variant based on seed modulo number-of-variants. // Pick a goal variant based on seed modulo number-of-variants.
// Three variants cycle through: timed, high-score, and open. // Six variants give a fortnight of variety before any repeat.
match seed % 3 { match seed % 6 {
0 => ChallengeGoal { 0 => ChallengeGoal {
date: date.to_string(), date: date.to_string(),
seed, seed,
@@ -50,6 +50,27 @@ fn generate_goal(date: &str, seed: u64) -> ChallengeGoal {
target_score: Some(4_000), target_score: Some(4_000),
max_time_secs: None, max_time_secs: None,
}, },
2 => ChallengeGoal {
date: date.to_string(),
seed,
description: "Win in under 3 minutes".to_string(),
target_score: None,
max_time_secs: Some(180),
},
3 => ChallengeGoal {
date: date.to_string(),
seed,
description: "Reach a score of 5 000 or more".to_string(),
target_score: Some(5_000),
max_time_secs: None,
},
4 => ChallengeGoal {
date: date.to_string(),
seed,
description: "Win in under 8 minutes".to_string(),
target_score: None,
max_time_secs: Some(480),
},
_ => ChallengeGoal { _ => ChallengeGoal {
date: date.to_string(), date: date.to_string(),
seed, seed,