Duck Race Simulator
Run a seeded duck race across the pond: choose three to eight ducks, press start and watch the finish order settle. The outcome is fixed by the seed, not by the clock.
How this simulation works
The race is a seeded model rather than a random draw: each duck gets a base speed from the seed, then advances by that speed multiplied by a seeded jitter on every step, and stops at the finish line. The finish order is recorded once and never revised. Because the only source of variation is the seed, the same seed and the same number of steps produce the same order every time; only the pacing of the animation uses the clock. Change the seed to run a different race.
How to use it
Pick how many ducks race, set a seed, then press Start. Pause holds the race, Step advances it one tick, and Reset returns every duck to the start line with the same seed.
Why it runs in your browser
The simulation runs on this page with JavaScript and the canvas API. Nothing is uploaded, no account is needed, and the page works offline after it loads.
This is a browser simulation of a duck race, drawn on a canvas. You choose a seed and a field of three to eight runners, and the duck glyphs advance along parallel lanes toward a finish line on the right.
The seed decides the finishing order. Each runner's advance per step is drawn from a generator seeded with the number in the seed field, so the same seed and the same runner count always produce the same result — and it predicts nothing about any real race.
Play advances the field on a timer, Step advances it one generation at a time, and Reset returns to the first frame from the seed. If your system asks for reduced motion, the page starts paused.
Why the outcome does not change
The model is a pure function from state to state, with a small seeded generator standing in for randomness. Nothing reads the clock and nothing touches the network, so a seed of 3141 with five runners finishes the same way on every machine.
Changing the number of runners starts a fresh race from the same seed, which re-deals the advances. That is why the finishing order can differ between five and six runners at one seed.
The race ends when every runner has crossed the line, not when the winner does, so a slow field takes longer to watch while the result is already decided.
- Seed: 0 to 9 999
- Runners: 3 to 8, default 5
- The clock affects only how fast you watch, never who wins
What a simulated race is good for
It is a demonstration of seeded simulation: one number determines a whole run, which is the property that makes a test able to replay it.
It is not a model of animals, odds or physics. The lane widths, speeds and gaps are drawing choices, and the outcome is a hash of the seed rather than a probability you can quote.
How to use the race controls
Set the Seed and choose three to eight Runners. Each runner's advance per step comes from the seeded generator, so the same seed with the same field always finishes in the same order.
Press Play to run the field on a timer, Step for one generation at a time, or Reset for the first frame. The page starts paused when the system asks for reduced motion.
What to Expect
Best for
- Watching a seeded simulation produce the same result twice
- Showing how one seed determines a whole animated sequence
- A lightweight canvas demonstration for a classroom or a demo
Not ideal for
- Predicting or betting on a real race, which this cannot inform
- A statistical simulation with distributions and confidence intervals
- A long animation, since the race runs until every runner finishes
What this tool keeps
- The finishing order for a given seed and runner count
- The first frame, which Reset restores exactly
- A paused start when reduced motion is requested
What may need cleanup
- Any inference about real events drawn from the result
- The runner count, which changes the whole race rather than one lane
- A race left mid-run, which Reset clears
Common errors
- Expecting a new winner from the same seed
- Treating the number of steps as random when the seed fixes them
- Reading the race as a probability model
Example use cases
- A demo of deterministic randomness
- A test fixture that needs a replayable animation
- A five-minute classroom illustration of seeding
Sample input
A seed of 3141 with five runners, then press Play.
Sample output
Five duck glyphs advancing at seeded intervals until all have crossed, in an order fixed by that seed.
Who this is for
- Teachers demonstrating seeded simulation
- Developers wanting a small canvas example
- Anyone curious how a seed fixes an outcome
Frequently asked questions
Is the duck race random on every run?
No. The finishing order is fixed for a given seed and runner count, and Reset restores the starting field exactly.
Can it predict a real race?
No. It is a canvas simulation with a seeded advance rule and says nothing about a real event.
Why did the whole race change when I added a runner?
The runner count changes the whole race rather than adding one lane, so the same seed produces a different order.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.