Solved

How does the checker test a "live" countdown?

JackStackOP edited

The output depends on the current time, so how can it pass?

1

Comments 4

Join the discussion

Already have an account? Log in

  1. LiamByte Solutionreplies: 2

    Stage 2 is the trick: by making countdown(launch, now) take now as a parameter, the checker can pass a fixed time and get predictable output. That's exactly why the challenge is structured this way — testable time.

    7
    1. JackStackOPreplies: 1

      Passing the clock in as a parameter. That's a really useful pattern.

      3
      1. NoahLoops

        Same idea as the medical dispenser article — don't trust the clock blindly, control it.

        2