Chef
- Description:
Chef.js provides computer opponents ("chefs") for Boxed Up. A computer chef examines a game using only the public
BoxedUpAPI and proposes a ply for the player to move, at one of three skill levels. Chefs are deterministic and pure: the same game always gets the same proposal.
- Source:
- Version:
- 2025/26
Members
(static) levels :number
Properties:
| Name | Type | Description |
|---|---|---|
apprentice |
number | 1 — Packs the smallest piece that fits, in the first free spot. |
cook |
number | 2 — Packs the largest piece that fits, claiming cells quickly. |
head_chef |
number | 3 — Packs the ply that most improves its score lead, fighting for compartment bonuses. |
The skill levels a computer chef can play at.
Type:
- number
Methods
(static) choose_ply(level, game) → {Chef.Ply|undefined}
- Description:
Proposes a ply for the player to move, at the given skill level. Returns
undefinedif the game has already ended. The proposal is always a legal ply; pass it toBoxedUp.placeto make the move.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
number | A skill level from |
game |
BoxedUp.Game | The game to propose a ply for. |
Returns:
The proposed ply,
or undefined if no ply is possible.
- Type
- Chef.Ply | undefined
(static) legal_plies(game) → {Array.<Chef.Ply>}
- Description:
Returns every legal ply available to the player to move: each piece from the menu, in each orientation, at each position where it may be packed.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
game |
BoxedUp.Game | The game to examine. |
Returns:
All legal plies, in a stable order.
- Type
- Array.<Chef.Ply>
Type Definitions
Ply
- Description:
A Ply is one proposed turn: which piece to pack, in which orientation, and where.
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
name |
string | The name of the piece,
a key of |
shape |
BoxedUp.Shape | The chosen orientation of the piece. |
position |
BoxedUp.Position | The anchor position to pack at. |
A Ply is one proposed turn: which piece to pack, in which orientation, and where.
Type:
- Object