Giter VIP home page Giter VIP logo

chess-js's Introduction

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

chess-js's People

Contributors

atomk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.