Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 2.05 KB

readme.org

File metadata and controls

60 lines (44 loc) · 2.05 KB

https://raw.githubusercontent.com/sunflowerseastar/chess/master/chess-readme.png

Chess

  • clutter-free chess app, 1 or 2 player (desktop)
  • full rule set, with the exception of promoting a pawn to a not-queen
  • traditional piece design
  • computer player (via spacebar/enter), although not a good one
  • openings table (partial)
  • supports FEN import/export
  • responsive

Todo

  • afford computer player on mobile
  • permit a player to promote a cross-board pawn to any piece
  • improve computer player middlegame (minmax, other?)
  • add computer player endgame
  • split out components

Quick Start

Pre-reqs:

Use figwheel-main, with config in project.clj.

lein fig:build # dev - localhost:9500
# http://localhost:9500/figwheel-extra-main/auto-testing
# or
lein fig -- -b dev -r

lein fig:min   # build
lein fig:test  # test

# cypress tests
yarn
yarn cy:open
yarn cy:run

For emacs dev, cider-jack-in-cljs from CIDER.

Overview

The codes lives in src/:

  • components.cljs - Reagent UI components
  • core.cljs - the app state and actions to update the state; UI root (main)
  • fen.cljs - translations to/from app state & FEN
  • helpers.cljs - utility functions
  • legal.cljs - pure functions that decide what moves are and aren’t with a given board & game state
  • openings_table.cljs - some common openings, pulled from Eduard Gufeld and Nikolai Kalinichenko’s Opening Repertoire for the Attacking Player
  • svgs.cljs - SVGs created to look like the pieces from said book

Tests are in test/chess/ and cypress/e2e/.