/chess

Chess game in ES6 TypeScript bundled with Webpack. Tests in ES6 TS running chai with mocha; Travis CI. Features: Castling, Promotion, En Passant. Purely functional logic, stateful Store.

Primary LanguageTypeScriptMIT LicenseMIT

chess

Build Status

Though I made this game for fun, I was able to include an online demo here, from my alma mater's domain (working while I still have access to the domain : )

Updated Demo: I also have a Heroku app, here, that automatically pulls and deploys the latest version of the chess game on this repository.

This is a chess game written in ES6 TypeScript, HTML 5, CSS (no fancy/modular Flexbox, CSS Grid Layout, or media queries in this simple game... maybe down the road), and bundled with the Webpack (4.10.0 / latest as of now). The View is modeled after the vanilla ES6 TodoMVC example. Chessplay GIF

Local Setup (copy-paste the following into a shell):

git clone https://github.com/riyadshauk/chess
cd chess
npm install
npm test # * optional step * should see all 65+ tests passing in shell : )
npm run build
open public/index.html # (open is a macos command, opens file in default browser)

Note: The game source files are already bundled into one javascript file, so it works locally without needing to install anything. Just open chess/front_end/public/index.html in a browser to play.

Todo: Codebase

  • heavily refactor codebase (make more modular, less coupled) (update: designed to MVCS pattern)
  • extract out logic from controller, make simpler / more concise / more readable (update: game logic is now contained in calls to Model)
  • revisit the decision to use Google Closure Compiler, refactor (update: Closure Compiler no longer used here!)
  • make tests forward-compatible with ES6 and look into testing libraries (ie mocha/chai)
  • refactor to use TypeScript (update: 100% TS with noImplicitAny: true)
  • simplify file heirarchy to more straightforward MVC structure (update: MVCS structure, naturally since Model is purely functional)
  • remove superfluous interfaces / abstraction, simplify; consider using a standardized interface / notation
  • make a version of this game where the VCS (in MVCS) is in React (naturally, using .tsx files)

Todo: Chess Gameplay Features

  • add game-end condition recognition
  • add undo/redo functionality (consider use of FEN, PGN, SAN)
  • add ability to load/save game
  • game timer
  • be able to play against computer/AI

Todo: General Project Features

  • users & client/server
  • chat
  • ML?
  • live extensibility