Horse Race Simulator
Stage a seeded horse race: three to eight runners, one finish line, and an order fixed by the seed rather than by chance. Runs in your browser.
How this simulation works
The race is a seeded model rather than a random draw: each horse 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 horses race, set a seed, then press Start. Pause holds the race, Step advances it one tick, and Reset returns every horse 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 horse race on a canvas. Choose a seed and a field of three to eight runners and the horse glyphs advance along parallel turf lanes toward a finish line on the right.
The seed and the number of steps decide the finishing order. Each runner's advance comes from a generator seeded with the number in the seed field, so the same seed and field produce the same result every time — and it forecasts nothing about a real race.
Play paces the field on a timer, Step advances one generation, and Reset returns to the first frame. A system set to reduced motion starts the page paused.
The model behind the race
The engine is a pure function from one state to the next, with a small seeded generator standing in for chance. It reads no clock and makes no request, which is why two runs of one seed agree.
The default field is six runners at seed 2718. Changing the field size starts a fresh race from the same seed, so the advances are re-dealt and the order can change between five and six runners.
A race ends when the last runner reaches the line, not when the first does, so the wait is always for the back of the field.
- Seed: 0 to 9 999
- Runners: 3 to 8, default 6
- Pacing uses the clock; the result does not
What the lanes are not
The lane widths, the gaps and the speeds are drawing choices. Nothing in the model corresponds to form, weight, going or a starting price.
It is a demonstration of reproducible animation, of the same kind the duck race and the marble race use, and the outcome is a hash of the seed rather than a probability.
How to use the race controls
Set the Seed and choose three to eight Runners on the turf lanes. Each runner's advance comes from the seeded generator, so the same seed and field finish the same way every time.
Press Play to pace the field on a timer, Step for one generation, or Reset for the first frame. The model forecasts nothing about any real race, and reduced-motion systems start paused.
What to Expect
Best for
- Watching a seeded race finish the same way twice
- Showing how one seed fixes a whole animated sequence
- A small canvas demonstration for a talk or a class
Not ideal for
- Predicting, pricing or betting on a real race
- A statistical model with odds and distributions
- A long run, since the race continues until the last runner finishes
What this tool keeps
- The finishing order for a given seed and field
- The first frame, restored exactly by Reset
- A paused start when reduced motion is requested
What may need cleanup
- Any inference about real horses or odds
- The field size, which re-deals the whole race
- A race stopped mid-run, which Reset clears
Common errors
- Expecting a different winner from the same seed
- Reading the race as a probability model
- Assuming Step and Play produce different outcomes
Example use cases
- A demo of deterministic randomness
- A replayable animation for a test
- A classroom illustration of seeding
Sample input
The default seed of 2718 with six runners, then Step a few times.
Sample output
Six horse glyphs advancing in seeded increments until all have reached the line, in an order fixed by that seed.
Who this is for
- Teachers showing reproducible simulation
- Developers wanting a canvas example
- Anyone curious how a seed fixes a result
Frequently asked questions
Is the horse race random on every run?
No. A seed and a field of three to eight runners fix the finishing order, and Reset restores the first frame exactly.
Can it price or predict a real race?
No. It is a canvas simulation with no odds, distributions or real horses.
Why did the race change when I changed the field size?
The field size re-deals the whole race rather than adding one lane.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.