A small collection of single-file HTML tools for teaching and practicing bridge, codifying Larry Cohen’s 2/1 bidding system.
| File | What it is |
|---|---|
bridge-engine.js |
Shared rule engine: card constants, hand evaluation, suit-quality classification, the rebid rules table, hand-generation helpers. Loaded by the quiz and the curator via <script src="bridge-engine.js">. |
bridge-quiz.html |
Interactive bidding quiz. Generates plausible 1m / 1M opener hands, asks for the opener’s rebid, evaluates against the rule engine. Tracks streak, per-rule mastery, and missed-hand review. |
bridge-quiz-curator.html |
Companion authoring tool. Generates a hand, lets you edit the rationale and alternates, then saves to a local library with one of three categories (Valid / Publish / Incorrect). Re-evaluate Library button regression-tests every saved entry against the current engine. |
bridge-presenter.html |
Live bridge presenter for postmortem teaching sessions. Loads LIN or PBN files, supports presenter / student modes, BroadcastChannel-based second-screen view, optional double-dummy analysis (DDS via embedded WASM). |
bridge-creator.html |
Companion authoring tool for the presenter — build boards, edit deals, set up animations, export LIN. |
bridge-review-notes.html |
Comment annotator for BBO .lin review files. Loads a .lin, shows each board’s auction and play as a timeline, and lets you drop comments at exact anchors (after a specific bid, before a specific trick), highlight boards (★), and write an overall takeaways block. Exports a merged .lin with the comments as nt| notes at those anchors — the presenter pops each note at that moment. Round-trippable (re-loading pre-fills your comments) and idempotent. |
quiz-styles.css is the canonical quiz design system — the opener’s-rebid
quiz look (tokens, 1000px frame, two-column quiz grid, auction table, hand
display, bidding box, feedback panel, badges, breakpoints). Every quiz
page links it before its own inline <style>, and any NEW quiz must do
the same:
<link rel="stylesheet" href="quiz-styles.css">
<style>/* page-specific rules only */</style>
Change the shared look in quiz-styles.css, never by editing one page’s
copy — per-page inline styles are for page-specific components and
deliberate overrides only (e.g. the combinations quiz’s narrower frame).
bridge-engine.js at runtime. The engine is the single source of truth for rules; changing a rule there flows through to both tools immediately.localStorage. The curator’s library lives under bridge-quiz-curator-library-v1. The quiz’s progress lives under bridge-quiz-state-v1.Open any of the HTML files directly from this folder — bridge-engine.js is loaded via a classic <script src> tag, which works under file:// in modern browsers. No build step.
If using GitHub Pages: push to main, enable Pages in the repo settings, and the files are immediately served at https://<owner>.github.io/bridge-tools/. Add ?file=bridge-quiz.html etc. or link the quiz/curator directly from a top-level index.html later.
TBD.