quest

Sign in to start training

quest keeps your progress, streaks, and scores tied to your account — so you can pick up on any device.

Synced everywhere. Progress follows you across laptop and phone.
Streaks & stats. See your daily run and every score over time.
Your profile. A name and avatar for the work you do here.

We only use Google to sign you in and sync progress. No posting, no contacts — ever.

Core Beginner

03  Pattern matching

match lets you branch on shape and value at once. Map coins to cents, then classify a point by which axis it sits on.

Step 3 / 3

In apply_bonus, add the bonus only when it is Some -- use if let.

Hints
  • if let Some(b) = bonus { ... } else { ... } -- a match for when you only care about one pattern.
03_match.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
fn apply_bonus(score: u32, bonus: Option<u32>) -> u32 {
    if let Some(b) = bonus {
        score + b
    } else {
        score
    }
}