A standalone Haskell implementation of the core rules behind Martian Chess.
The project focuses on the engine layer rather than UI: board parsing, move generation, move execution, scoring, and winner detection.
- FEN-like board representation for compact game states
- Board parsing and serialization
- Move generation for pawns, drones, and queens
- Move execution with scoring and piece-combination logic
- Winner detection based on remaining material and score
- CLI for quick testing and experimentation
- Unit tests for core engine behavior
.
├── app/Main.hs # CLI entry point
├── src/Board.hs # Board model, FEN parsing, serialization
├── src/Logic.hs # Move rules, scoring, and winner logic
├── test/Spec.hs # Engine-focused tests
├── package.yaml
├── martian-chess-engine.cabal
└── stack.yaml
stack buildstack run -- validateFEN "qqd1/qdp1/dpp1///1ppd/1pdq/1dqq"
stack run -- pawnMoves "//////1p2/" Bottom b1 none
stack run -- makeMove "///1p2///1d2/" b1-b4
stack run -- playerWon "///////1p2" Bottom 3 3stack testqqd1/qdp1/dpp1///1ppd/1pdq/1dqq
This repository is intentionally scoped as a rules engine. It is a good base for adding:
- a GUI or web frontend
- AI/search-based move selection
- game-state evaluation heuristics
- property-based tests
- serialization utilities for saved matches