RoboSoccer Scorer

Used live at Robotics at Exun 2026

RoboSoccer
Scorer

I was the event in-charge for RoboSoccer at Robotics at Exun 2026, held at DPS R.K. Puram on 31 October. I built this to run the whole knockout tournament: the scoreboard, the clock, the draw and the bracket. It ran on a laptop mirrored to the hall projector.

The demo opens a sample tournament partway through a quarter-final. Nothing you do is saved.

The match screen: Voltrix 1, Gear Grinders 1, 1:24 left in the first half of a quarter-final, with the next match and tournament records underneath.

The match screen, shown with sample teams: score, clock, one button for whatever happens next, who plays after, and records as they fall.

2–32teams per knockout, byes placed automatically
260 KBthe whole app in one HTML file, fonts included
0runtime dependencies or servers
23automated tests on the rules, draw and replays

The brief

A tournament run in front of everyone

Robot football at a school event is loud and fast. Matches are a few minutes long, one after another, with teams waiting their turn and everyone watching the projector. Whoever runs the laptop is also watching the pitch, so the software has to be hard to get wrong.

A spreadsheet and a phone timer could keep score. They could not settle the things that actually cause arguments on the day: was the draw fair, what happens after a wrong tap, and what if the Wi-Fi drops. Each of those became a design decision.

Three design decisions

What makes it work

Anyone can check the draw

Every bracket comes from just two inputs: the team names and a 12-character draw code printed on the bracket. The names are sorted, hashed with the code to seed a small deterministic random generator, and shuffled with Fisher–Yates using rejection sampling so no team is favoured.

Same names and code, same bracket, in any browser or in Node. Anyone can rerun it afterwards with npm run verify. Redraws are counted on screen, so an organiser redrawing until they like the result would be visible to the whole room.

Draw code

K7QM-2XRA-9DPF

+ these 10 names, always gives

M1 Robo Rangers v Mech Mavericks
M2 Kinetic v Team Titans
6 byes, spread over the bracket

Every tap is an event

The app never stores the score. It stores a list of timestamped events (start, goal, pause, time up, winner) and rebuilds the whole tournament by replaying them. That one choice gives undo for any action, not just the last goal.

It also makes the app refresh-safe: close the tab mid-match and it comes back with the same score and the clock still running, because the clock is worked out from timestamps. A backup is just the event list, so another laptop can take over exactly where the first one stopped.

Event log, example
  1. start
  2. goal · White
  3. goal · White
  4. goal · Black
  5. timeUp · written by the clock

One file, no internet

School Wi-Fi in a hall full of robots and phones cannot be trusted. The build step inlines the code, styles, fonts and logo into a single HTML file that runs from a USB stick with nothing installed.

The live site serves that same file, so it is also the offline copy. Download it here and it works with the network unplugged.

dist/robosoccer.html
260 KB

Code, styles, two typefaces and the club logo. No network requests.

On the day

How it ran in the hall

The knockout bracket for 10 teams with draw code K7QM-2XRA-9DPF, results filled in for the first three matches and match 4 marked live.

The bracket fills itself in as matches finish. Winners move on without anyone touching it.

  1. Make the draw. Paste the team list, press Make fixtures, and the bracket and its draw code go up on the projector.
  2. One button runs the match. It always says what happens next: start, pause, second half, golden goal. Goals are one big tap per side.
  3. Save after each round. One click writes the event log to a file, and results export to CSV.

Under the hood

How it is built

Plain JavaScript, no framework. The match rules, draw, records and replay are pure modules with no browser code, so they are tested directly in Node. The browser layer only turns state into HTML and taps into events.

Language
JavaScript (ES modules)
Build
esbuild, plus a script that inlines everything into one file
Tests
node:test: the draw, match rules, full tournaments, backups
Randomness
cyrb128 hash seeding sfc32, Fisher–Yates shuffle
Rules
2 × 3 min halves (final 2 × 4), golden goal, then penalties
src/
  clock.js       clock from timestamps
  draw.js        draw codes, seeded shuffle, byes
  match.js       match phases and rules
  records.js     fastest goal, biggest win
  tournament.js  applies events; replay
  store.js       event list, undo, backups
  main.js        clicks, keys, clock tick
  ui/            views, sound, confetti
tools/verify-draw.mjs
test/           node:test suites

Watch a match play out

The demo starts mid-match with the clock running. Score a goal, undo it, finish the half, or open the bracket. It is built for a laptop on a projector, so it is best on a big screen.