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

02  Control flow

Loops and conditionals: sum a range, then write the classic fizzbuzz for a single number.

Step 1 / 3

Sum 1, 2, ..., n in sum_to.

Hints
  • for i in 1..=n { ... } iterates inclusively.
02_control_flow.rs
Reset to starterCompiled in a sandbox; hidden checks must pass.
Reveal solution
fn sum_to(n: u32) -> u32 {
    let mut total = 0;
    for i in 1..=n {
        total += i;
    }
    total
}