Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.07 KB

README.md

File metadata and controls

62 lines (43 loc) · 1.07 KB

Chess

A chess board to use in command-line or GUI apps

This project is meant to be used for production apps.



Features

How to use

Play moves

Moves are played by passing algebraic notations to the chess board

let board = ChessBoard()
board.play(move: "e4")

Print the board

Print the content of the chess board using the following code

print(board.gui)
// ===============
//   ♖       ♔ ♖   
// ♙ ♗ ♙ ♝ ♝ ♙   ♙ 
//   ♗       ♟     
//                 
//                 
//     ♟     ♕     
// ♟         ♟ ♟ ♟ 
//       ♜     ♚   
// 
// ===============

Print the PGN

Print the PGN of the chess board using the following code

print(board.pgn)
// 1. e4 e5 2. Nf3 Nc6

To Do

  • Write Tests
  • Complete descriptions for ChessBoardError
  • Prevent castle if in, going through or ending in
  • Complex PGNs (Event, Site, Date, Round, White, Black, Result, Comments, Variation)