Skip to content

feat: implement mecha duel#9

Merged
devp merged 7 commits intomainfrom
claude/plan-mecha-duel-r3iyb
Feb 1, 2026
Merged

feat: implement mecha duel#9
devp merged 7 commits intomainfrom
claude/plan-mecha-duel-r3iyb

Conversation

@devp
Copy link
Owner

@devp devp commented Jan 31, 2026

feat(mecha-duel): register game in registry (Phase 7)

  • Add MechaDuel to registry.ts with game definition
  • Fix unused variable/import warnings:
    • Remove unused imports from Board.tsx
    • Remove unused boardStyle variable
    • Prefix unused piece parameter with underscore
    • Remove unused BOARD_SIZE from test imports

All 103 tests passing, build successful.

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc

- Define Position, PieceType, PieceState, Piece, CommittedPiece types
- Define MechaDuelState interface
- Add position helpers: posToIndex, indexToPos, isValidPos, posEquals
- Add constants for board size, directions, knight jumps
- Add createInitialPieces helper
- Create stub game definition

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
- Create scenarios.ts with modular scenario system
- Add simple scenario with symmetric pawn placement
- Add createInitialBoard helper to initialize board from scenario
- Update game setup to use scenario-based initialization
- Kings placed at (4,0) and (4,7), pawns at corners of center

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
Tests written before implementation for:
- Position helpers (passing)
- Board setup (passing)
- Commit validation: isValidBishopTarget, isValidRookTarget, etc.
- Strike resolution: raycast, resolveStrike
- Knight resolution: isValidKnightJump, resolveKnight
- KingStep resolution: isValidKingStep, resolveKingStep
- Piece state transitions: transitionPieceState, refreshPieces
- Win conditions: checkWinCondition

31 tests pass, 45 fail (pending implementation)

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
Phase 3 - Game Moves:
- Add commit validation: isValidBishopTarget, isValidRookTarget,
  isValidKnightTarget, isValidQueenTarget
- Add raycast and resolveStrike for strike attacks
- Add isValidKnightJump and resolveKnight for knight movement
- Add isValidKingStep and resolveKingStep for king movement
- Add piece state transitions: transitionPieceState, refreshPieces
- Implement all four moves: commit, execute, kingStep, pass

Phase 4 - Win Conditions:
- Add checkWinCondition function
- Add endIf to game definition

All 76 tests now passing.

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
- Create Board.tsx with full game UI:
  - 8x8 grid display with Kings, Pawns, committed pieces
  - Action buttons: Commit, Execute, KingStep, Pass
  - Piece selection for committing
  - Multi-select for executing committed pieces
  - Valid move highlighting
  - Piece supply display (ready/committed/exhausted)
- Create index.ts with game and Board exports

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
Add ai.enumerate function that enumerates all legal moves:
- All valid Commit moves (piece type × valid target squares)
- All Execute combinations (non-empty subsets of committed pieces)
- All valid KingStep moves (8 directions when valid)
- Pass (always valid)

Compatible with MCTSBot for AI play.

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
- Add MechaDuel to registry.ts with game definition
- Fix unused variable/import warnings:
  - Remove unused imports from Board.tsx
  - Remove unused boardStyle variable
  - Prefix unused piece parameter with underscore
  - Remove unused BOARD_SIZE from test imports

All 103 tests passing, build successful.

https://claude.ai/code/session_01G2NbWZYWsFUY3KPhwErBwc
@netlify
Copy link

netlify bot commented Jan 31, 2026

Deploy Preview for devp-fgj-js ready!

Name Link
🔨 Latest commit 85b6f49
🔍 Latest deploy log https://app.netlify.com/projects/devp-fgj-js/deploys/697e82aad3bafe0009efeaa7
😎 Deploy Preview https://deploy-preview-9--devp-fgj-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@devp devp merged commit 6552f7e into main Feb 1, 2026
5 checks 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