@rafapaezbas/chess-cli

1.0.1 • Public • Published

Chess-cli

Javascript chess cli.

♜ ♞ ♝ ♛ ♚

chess board

npm install -g @rafapaezbas/chess-cli
chess-cli

How to play.

Control the cursor with arrows. Select piece with return key.

Api

const Chess = require('@rafapaezbas/chess-cli')
const chess = new Chess()

getPosition(fen = false)

const jsonPosition = chess.getPosition()
const fenPosition = chess.getPosition(true)

move({ src, dst })

chess.getPosition({ src:12, dst:28 }) // e4

moveIsLegal({ src, dst })

// inital position
const isLegal = chess.moveIsLegal({ src:12, dst:28 }) // true

start()

Starts key controls and rules of movements to cursor control.

chess.start()

Readme

Keywords

none

Package Sidebar

Install

npm i @rafapaezbas/chess-cli

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

5.32 kB

Total Files

5

Last publish

Collaborators

  • rafapaezbas