sunflowerseastar / chess

chess engine & UI

Home Page:https://chess.sunflowerseastar.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/.

About

chess engine & UI

https://chess.sunflowerseastar.com

License:GNU Affero General Public License v3.0


Languages

Language:Clojure 84.8%Language:TypeScript 8.9%Language:CSS 5.1%Language:HTML 1.2%