Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Release 0.1.2 #2

Merged
merged 10 commits into from
May 20, 2021
Merged
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import createBoard from './src/board/create-board.js';
import * as validation from './src/validation.js';
import findAllMoves from './src/validation/all-moves.js';
import isCheck from './src/validation/is-check.js';
import gameEndingStatus from './src/validation/ending';

import gameEndingStatus from './src/validation/ending.js';
import undo from './src/board/undo.js'

export default {
setupBoard,
createBoard,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fenfurnace",
"version": "0.1.1",
"version": "0.1.2",
"description": "A chess engine designed to work entirely from a FEN position.",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function makeMove(startCell, endCell, { isTest } = {}) {
} else {
global.enpassantSquare = '-';
}

//check checker
if (isCheck(global.currentTurn)) {
global.boardArray = beforeState;
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/validation/is-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default function isCheck(colour) {

const pieceColour = pieces.getColour(cell);
if (
((pieces.isWhite(pieceColour) && colour === 'b')
((pieceColour === 'w' && colour === 'b')
||
(pieces.isBlack(pieceColour) && colour === 'w'))
(pieceColour === 'b' && colour === 'w'))
&&
validation.validateMove(cell, kingCells[colour])
) {
Expand Down