Skip to content

Bricka - #515

Merged
Perlkonig merged 8 commits into
AbstractPlay:developfrom
th555:bricka
Oct 24, 2026
Merged

Bricka#515
Perlkonig merged 8 commits into
AbstractPlay:developfrom
th555:bricka

Conversation

@th555

@th555 th555 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Marino's game Bricka, rules here https://www.pergioco.net/1/bricka-en.html

@Perlkonig

Copy link
Copy Markdown
Member

Did an agent review and a cursory look over the game file. I haven't read the rules, so the agent may be offbase in its rules interpretations. Here are some things to consider before we merge:

Blockers (rules correctness)

  1. Active / blocked cells — Rules define active/blocked cells as those that share the intersection where a stone was (just) placed. adjacentRegions() currently selects regions whose center is in the 8 neighboring grid squares, not regions whose cells include that intersection. That affects neutral conversion, turn blocking, and blocked markers. Please switch to region membership (e.g. regions.filter(r => r.cells.includes(cell))) and verify against the rules example (e.g. after f6, blocked intersections / grey cells).

  2. Neutral majority — Majority is over intersections not occupied by neutral (e.g. 5 intersections, 1 neutral → 4 remaining, majority 3). The code uses region.cells.length and only counts the mover’s stones; with multiple neutrals on a cell the threshold can be wrong. Denominator should follow “remaining non-neutral” slots.

  3. Double-pass endgame — If both players are forced to pass with no connection, rules say count own-color stones (draw possible). checkEOG() returns early on any pass and doesn’t handle consecutive passes; please add that path (and a test).

  4. Both players connect — If both have a valid connection after a move, the player who just moved wins. Please confirm the neutral-stone / otherPlayer() win branch can’t award the opponent when the mover also connected on the same turn.

Strongly recommended (AP norms)

  1. experimental flag on gameinfo for initial catalogue ship.

  2. test/games/bricka.test.ts — At minimum: region/blocking vs rules, neutral majority edge cases, wins (including neutral placements), full-board / pass tiebreak. Hula tests are a good template.

  3. Constructor error — Replace copy-paste The Tritium engine cannot process... with Bricka (or generic game uid).

  4. winningGroup — Either populate on win for render highlight (like Hula’s winningLoop) or remove from state/render until needed.

Nice to have

  1. categories — Board/component tags consistent with similar connection games (e.g. components>simple>3c).

  2. Neutral colour — Consider gameinfo.customizations and the custom colour function instead of hardcoded #aaa in legend.

  3. Types/style — Array<IMoveState> / Array<APMoveResult>, import quote style, etc. (stack!: Array, results: Array = [] should be Array<IMoveState> / Array<APMoveResult>; import {union} from 'graphology-operators' vs repo double-quotes; trailing }; on class.)

@th555

th555 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author
  1. is not right, the current implementation is equivalent to the llm's suggestion but more efficient.
  2. is correct, I've fixed it, good catch.
  3. double pass can never occur (I've confirmed with the designer).
  4. can confirm.
  5. done
  6. I'll add some tests, forgot about that.
  7. fixed, also in Hula.ts ;)
  8. right, intended to do that but then forgot - done.
  9. done.
  10. good call, done.
  11. Fixed the quotes but don't know what the Array stuff is about, it's already in the suggested style.

@Perlkonig

Copy link
Copy Markdown
Member

Will merge this and you can submit an updated PR when you're ready.

@Perlkonig
Perlkonig merged commit acda0c5 into AbstractPlay:develop Oct 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants