1.0.1 • Published 3 years ago
@rafapaezbas/chess-cli v1.0.1
Chess-cli
Javascript chess cli.
♟ ♜ ♞ ♝ ♛ ♚

npm install -g @rafapaezbas/chess-cli
chess-cliHow 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 }) // e4moveIsLegal({ src, dst })
// inital position
const isLegal = chess.moveIsLegal({ src:12, dst:28 }) // truestart()
Starts key controls and rules of movements to cursor control.
chess.start()