powergrid/engine
goldjohn6 de6f0703fb
End a game nobody can finish, and never sell a 9999 city (#165)
UK & Ireland's island jump needs an empty city, so a player locked on one
island tops out at its cities (14 and 12 on a 4-region board). If nobody
crosses before the other island fills, no one can ever reach the end count
and the game never ended. Two seeded bot games showed how master escaped:
after ~105 rounds a player saved $9999 and bought a city priced 9999, the
engine's "impossible" marker (occupied, or across the sea).

New games store options.stallEnds. For them, the game ends after a Step 3
Building phase in which no active player could ever build again (whatever
their money), scored as usual; and a 9999 price is never affordable.
Older games have no stamp (reconstructionOptions forces it off), so they
play and replay exactly as before.

Build pricing moves out of availableMoves into buildOptions() so the
money-filtered moves and noPlayerCanBuild() share every map rule.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 14:11:27 -08:00
..
.vscode ✨ (all) Add Germany map, update map structure 2021-10-27 22:49:46 -03:00
src End a game nobody can finish, and never sell a 9999 city (#165) 2026-11-04 14:11:27 -08:00
.eslintignore 💚 (engine) add dist folder to eslint ignore 2021-10-29 18:30:11 -03:00
.eslintrc.js China: correct seven city names and the Changchun-Jilin cost (#59) (#117) 2026-08-14 09:26:23 -07:00
.gitignore Initial 2021-10-13 00:09:21 -03:00
.pnpm-debug.log Initial 2021-10-13 00:09:21 -03:00
.travis.yml Initial 2021-10-13 00:09:21 -03:00
index.ts feat: allow revising sealed bids and powered plants 2026-10-05 01:36:01 +02:00
LICENSE Initial 2021-10-13 00:09:21 -03:00
package-lock.json 🚨 (engine) Fix lint 2022-02-04 09:38:54 -03:00
package.json 🔖 powergrid-engine 2.0.22 2026-11-01 16:24:40 +00:00
pnpm-lock.yaml Revert "add devcontainer and specify pnpm version" 2025-08-09 20:52:36 +00:00
README.md Running pretter, fixing names 2021-10-22 19:29:36 -03:00
tsconfig.json ✅ (engine) add full game tests 2021-11-21 15:04:44 -03:00
wrapper.ts Wien garbage never free in Central Europe; UK & Ireland "completely vacant city" wording (#162) 2026-11-01 08:20:20 -08:00

powergrid-engine

Typescript engine for Power Grid.

Setup

Requirements

Recent version of node / pnpm.

Dependencies

In the project's folder:

pnpm

Build

To compile Typescript into javascript:

pnpm build

Test

pnpm test