Skip to content

beratmutlu/martian-chess-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Martian Chess Engine

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.

Features

  • 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

Project Structure

.
├── 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

Build

stack build

Run

stack 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 3

Test

stack test

Example Starting Position

qqd1/qdp1/dpp1///1ppd/1pdq/1dqq

Notes

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

About

Standalone Martian Chess engine in Haskell with board parsing, legal move generation, scoring, and endgame detection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors