Skip to content

Nimzozo/Ab-Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AbChess

Codacy Badge

AbChess API for JavaScript provides the tools to build HTML playable chessboards with animated pieces. It also lets you import, play and export chessgames with the PGN notation.

Features

  • Chessboard :

    • customizable board and pieces
    • playable pieces :
      • with two-clicks
      • with drag-and-drop
    • animated pieces :
      • for moves
      • for wrong moves
      • for captures
      • for position changes
  • Chess logic :

    • pieces basic movements
    • pieces special rules :
      • promotion
      • en passant
      • castling
      • kings opposition
    • check detection
    • result detection :
      • checkmate
      • stalemate
      • 50 moves rule
      • insufficient material
  • Validation :

    • FEN string
    • PGN string
  • Game :

    • input moves and get data
    • parse a PGN string and display the game

Getting started

Download the latest release and simply follow these steps :

Load the CSS file.

<link rel="stylesheet" href="AbChess-x.x.x.css">

Add a chessboard container.

<div id="chessboard"></div>

Load the JavaScript file.

<script src="AbChess-x.x.x.js"></script>

This script will display a chessboard with the default configuration.

var abChess = new AbChess("chessboard");
abChess.setFEN();

Documentation

More informations are available on the GitHub pages :

License

Chess resources