1.2.3 • Published 4 years ago

chesssk v1.2.3

Weekly downloads
3
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

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

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.91

4 years ago

1.1.7

4 years ago

1.1.71

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.92

4 years ago

1.0.9

4 years ago

1.0.91

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago