Skip to content

Merge pull request #9 from devp/claude/plan-mecha-duel-r3iyb feat: implement mecha duel#10

Closed
devp wants to merge 8 commits intoclaude/implement-tak-game-QjxhGfrom
main
Closed

Merge pull request #9 from devp/claude/plan-mecha-duel-r3iyb feat: implement mecha duel#10
devp wants to merge 8 commits intoclaude/implement-tak-game-QjxhGfrom
main

Conversation

@devp
Copy link
Owner

@devp devp commented Feb 1, 2026

No description provided.

claude and others added 8 commits January 31, 2026 22:11
- 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 Feb 1, 2026

Deploy Preview for devp-fgj-js ready!

Name Link
🔨 Latest commit 6552f7e
🔍 Latest deploy log https://app.netlify.com/projects/devp-fgj-js/deploys/697ed044741ccf000839a5a8
😎 Deploy Preview https://deploy-preview-10--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 closed this Feb 1, 2026
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