A just-for-fun JS chess library riddled with suboptimal code. This was an exercise in problem solving, which meant no Googling for optimal solutions. This library is a WIP and isn't usable yet.
$ npm install pillow-chess
const pchess = require('pillow-chess');
const game = pchess.Game;
game.newGame({rules: 'standard'});
game.movePiece('e2e4');
You can generate an ASCII or Unicode output of a board state:
let ascii = game.printASCII();
let unicode = game.printUnicode();
console.log(ascii);
> +---+---+---+---+---+---+---+---+
> 8 | r | n | b | q | k | b | n | r |
> +---+---+---+---+---+---+---+---+
> 7 | p | p | p | p | p | p | p | p |
> +---+---+---+---+---+---+---+---+
> 6 | | | | | | | | |
> +---+---+---+---+---+---+---+---+
> 5 | | | | | | | | |
> +---+---+---+---+---+---+---+---+
> 4 | | | | | | | | |
> +---+---+---+---+---+---+---+---+
> 3 | | | | | | | | |
> +---+---+---+---+---+---+---+---+
> 2 | P | P | P | P | P | P | P | P |
> +---+---+---+---+---+---+---+---+
> 1 | R | N | B | Q | K | B | N | R |
> +---+---+---+---+---+---+---+---+
> a b c d e f g h