1.2.3 • Published 5 years ago
chesssk v1.2.3
CheSSsk Library
Description
Still a WIP
A library for chess move validation based on location and board data.
- Set up new game
- Load game from database JSON string
- Export board data to JSON string for saving
- Get valid moves for pieces based on location
- Make only valid moves for pieces
- En passant
- King check and checkmate status updates
- Pawn exchange
Example Usage
Creating a new game and getting valid moves for a location
const chesssk = require("chesssk"); const game = new chesssk(); game.setupNewGame(); let validMoves = game.getValidMoves("b1"); console.log(validMoves);
Load a game from database, make a move, and get new grid data in json string
const chesssk = require("chesssk"); const game = new chesssk(); game.setGridFromJSON( db.jsonGameData ); let moveResult = game.move("b2", "b4", db.enPassantString); let dbJsonStringToSave = game.getGridInJSON(); // do database and client updates with moveResult object and new grid data console.log(moveResult, dbJsonStringToSave);
1.2.3
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.9
5 years ago
1.1.8
5 years ago
1.1.91
5 years ago
1.1.7
5 years ago
1.1.71
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.92
5 years ago
1.0.9
5 years ago
1.0.91
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago