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

Commit

Permalink
Release 0.3.0 (#12)
Browse files Browse the repository at this point in the history
* Move validation functions into separate files

* Create static game data object

* Use game data object instead of global

* Fix imports and refactor

* Version 0.3.0
  • Loading branch information
Nixinova authored Jul 4, 2021
1 parent 408f7aa commit 7da2234
Show file tree
Hide file tree
Showing 21 changed files with 472 additions and 423 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = off

[*.{js,json}]
indent_style = tab
indent_size = 4
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
Expand Down
18 changes: 5 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
Object.assign(global, {
castling: { w: { k: true, q: true }, b: { k: true, q: true } },
boardArray: [],
enpassantSquare: null,
moveList: [],
currentTurn: null,
halfMoveCount: 0,
moveNumber: 0,
promotionPiece: null,
logList: [],
});

import gameData from './src/variables.js';
import setupBoard from './src/board/setup-board.js';
import createBoard from './src/board/create-board.js';
import * as validation from './src/validation.js';
import * as validation from './src/validation/validation.js';
import makeMove from './src/validation/make-move.js';
import findAllMoves from './src/validation/all-moves.js';
import isCheck from './src/validation/is-check.js';
import gameEndingStatus from './src/validation/ending.js';
import undoMove from './src/board/undo.js';

export default {
gameData,
setupBoard,
createBoard,
makeMove,
validation,
findAllMoves,
isCheck,
Expand Down
Loading

0 comments on commit 7da2234

Please sign in to comment.