Pinball machine for developers. Ball is a deploy request, flippers are rollback/forward, bumpers are tests, tilt is rate limiting.
  • JavaScript 100%
Find a file
2026-06-15 21:38:45 +00:00
src feat(#1): pinball engine — ball, flippers, bumpers, targets, tilt, ASCII table 2026-06-15 21:38:30 +00:00
tests feat(#1): pinball engine — ball, flippers, bumpers, targets, tilt, ASCII table 2026-06-15 21:38:30 +00:00
package.json feat(#1): pinball engine — ball, flippers, bumpers, targets, tilt, ASCII table 2026-06-15 21:38:30 +00:00
README.md feat(#1): pinball engine — ball, flippers, bumpers, targets, tilt, ASCII table 2026-06-15 21:38:30 +00:00

code-pinball

Pinball machine for developers. Ball is a deploy request, flippers are rollback/forward, bumpers are tests, tilt is rate limiting.

Usage

const { PinballMachine, BUMPER_TYPES, TARGET_TYPES } = require('./src/pinball');

const machine = new PinballMachine('Deploy Defender');

// Launch a ball (deploy request)
machine.newBall();
machine.launchBall(60);

// Play!
for (let i = 0; i < 200; i++) {
  if (Math.random() < 0.3) machine.flipLeft();  // rollback
  if (Math.random() < 0.3) machine.flipRight(); // fast-forward
  machine.tick();
}

console.log(machine.tableView());
console.log(machine.report());

Bumpers

  • Test Bumper (100 pts) — Hits all tests
  • Lint Bumper (50 pts) — Code style check
  • Security Bumper (200 pts) — Security scan
  • Coverage Bumper (150 pts) — Code coverage

Targets

  • Code Review (500 pts) — Get approval
  • Sign-off (500 pts) — Stakeholder approval
  • Canary Check (300 pts) — Canary deployment passed
  • Hit ALL targets = 2000 pt bonus + multiplier increase!

Flippers

  • Left (Rollback) — Saves the ball/deploy
  • Right (Fast-Forward) — Keeps it going

Tilt System

Too many flips (rate limiting) triggers TILT — flippers disabled!