# Reference patch — 03-board-supplied-at-construction

The answer key for how the reference absorbs this change, and the thing that makes `budget.json`
reproducible. **Never shipped to the candidate.**

1. **Overlay** `../contract-delta/Entry.java` onto `contract/Entry.java` and **add**
   `../contract-delta/Board.java` to `contract/`. Contract files are given, so nothing here is
   charged.

2. **Add four lines** to `reference/src/Game.java`, immediately above the
   `Game(BoardLayout, List<String>, Dice)` convenience constructor:

   ```java
   /** A game on a board handed in from outside, with the standard players and rules. */
   public Game(Board board, Dice dice) {
       this(new BoardLayout(board.squares(), board.effects()), List.of("A", "B"), dice);
   }
   ```

There is **no new file, no new rule, and no change to any existing line.** `BoardLayout` already
took a square count and a map of effects, `Game` already took a `BoardLayout`, and `BoardLayout`
already checked its own legality in its constructor — including the loop check — so all three of the
rejection tests pass without a line being written for them.

## What this curveball actually measures

It reads like a feature and is really a question about where the numbers live. A design that wrote
`30` and the eight snakes and ladders into its game class — or worse, into its move method — pays
for this properly: the board has to become a parameter, every use of the old constants has to be
found, and the legality checks have to be written from scratch because a hardcoded board never
needed any. That is the difference the 6-line budget is measuring against.

The reference pays 4 lines, and all 4 are the new constructor's own declaration — the cost of
translating the contract's `Board` at the boundary into the reference's own `BoardLayout`, which is
the type that carries the invariants. Doing the same wiring inside the contract's own `Entry.create`
instead would measure 0, and the budget covers either choice comfortably. Keeping it in `Game` is the
better answer to defend: the boundary translation belongs to the code that owns the invariant, not to
a factory that is supposed to be one line.

## Measurement

`reference_diff = 4` (4 added, 0 removed, one file touched), so
`diff_budget = max(3, 4 + ceil(4/2)) = 6`.

Both suites are green after the patch: the curveball suite **10 tests, 10 passed**, and the base
suite **16 tests, 16 passed** — this change is purely additive, so the standard game is expected to
keep working and does.
