Skip to content
/ chess-js Public

The chess game everyone knows and loves, in vanilla JavaScript.

License

Notifications You must be signed in to change notification settings

Atomk/chess-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess-js

The chess game everyone knows and loves, in vanilla JavaScript. Try it out!

Features

  • Chess variants (6x6, 5x5)
  • Basic AI
  • Basic pawn promotion (always promoted to queens)

Notes

  • The icons used for the pieces are just Unicode characters, they may look different depending on your device/browser. By default they should be displayed as text. Most systems have only an emoji for the pawn, Samsung created an emoji for every single piece. On Microsoft Edge you'll see only the pawn displayed as emoji and the other pieces as text. On Chrome everything seems to work the way it is intended.

    Windows 10 (Chrome) Samsung
    Screenshot on Windows 10 Screenshot on Samsung
  • I used mostly ES6 features (arrow functions, let, const, class, template strings) without using any transpiler, which means some old browsers like Internet Explorer are not supported.

Mistakes

  • Just "going with the flow", not planning many things ahead. This approach is more fun since things are discovered and done step-by-step, but as the project got bigger I realized how planning things ahead would have saved a few of hours of refactoring.
  • Not using classes from the start, or at least modules, to separate responsibilities. I ended up with almost 1000 lines of code in the same scope, a bit of organization is necessary to keep things manageable.

To-do

Releases

No releases published

Packages

No packages published