├── .gitignore ├── network_dump └── placeholder.txt ├── game_state └── training_case │ └── placeholder.txt ├── assets ├── git readme image.png ├── 2D │ ├── piece │ │ ├── black_king.png │ │ ├── black_pawn.png │ │ ├── black_queen.png │ │ ├── black_rook.png │ │ ├── transparent.png │ │ ├── white_king.png │ │ ├── white_pawn.png │ │ ├── white_queen.png │ │ ├── white_rook.png │ │ ├── 0-black_king.png │ │ ├── 0-black_pawn.png │ │ ├── 0-black_queen.png │ │ ├── 0-black_rook.png │ │ ├── 0-transparent.png │ │ ├── 0-white_king.png │ │ ├── 0-white_pawn.png │ │ ├── 0-white_queen.png │ │ ├── 0-white_rook.png │ │ ├── 1-black_king.png │ │ ├── 1-black_pawn.png │ │ ├── 1-black_queen.png │ │ ├── 1-black_rook.png │ │ ├── 1-transparent.png │ │ ├── 1-white_king.png │ │ ├── 1-white_pawn.png │ │ ├── 1-white_queen.png │ │ ├── 1-white_rook.png │ │ ├── black_bishop.png │ │ ├── black_knight.png │ │ ├── white_bishop.png │ │ ├── white_knight.png │ │ ├── 0-black_bishop.png │ │ ├── 0-black_knight.png │ │ ├── 0-white_bishop.png │ │ ├── 0-white_knight.png │ │ ├── 1-black_bishop.png │ │ ├── 1-black_knight.png │ │ ├── 1-white_bishop.png │ │ └── 1-white_knight.png │ └── overlay │ │ ├── selected │ │ ├── 1-1.png │ │ ├── 1-2.png │ │ ├── 1-3.png │ │ ├── 1-4.png │ │ ├── 2-2.png │ │ ├── 2-3.png │ │ ├── 2-4.png │ │ ├── 3-3.png │ │ ├── 3-4.png │ │ └── 4-4.png │ │ ├── normal_move │ │ ├── 1-1.png │ │ ├── 1-2.png │ │ ├── 1-3.png │ │ ├── 1-4.png │ │ ├── 2-2.png │ │ ├── 2-3.png │ │ ├── 2-4.png │ │ ├── 3-3.png │ │ ├── 3-4.png │ │ └── 4-4.png │ │ ├── attacking_move │ │ ├── 1-1.png │ │ ├── 1-2.png │ │ ├── 1-3.png │ │ ├── 1-4.png │ │ ├── 2-2.png │ │ ├── 2-3.png │ │ ├── 2-4.png │ │ ├── 3-3.png │ │ ├── 3-4.png │ │ └── 4-4.png │ │ ├── originals │ │ ├── selected.png │ │ ├── normal_move.png │ │ ├── attacking_move.png │ │ └── previous_move.png │ │ └── previous_move │ │ ├── 1-1.png │ │ ├── 1-2.png │ │ ├── 1-3.png │ │ ├── 1-4.png │ │ ├── 2-2.png │ │ ├── 2-3.png │ │ ├── 2-4.png │ │ ├── 3-3.png │ │ ├── 3-4.png │ │ └── 4-4.png └── game_states │ └── chess_default_start.txt ├── shaders ├── fragment_shader.fs └── vertex_shader.vs ├── LICENSE.txt ├── training_cases ├── board_0.txt ├── board_1.txt ├── board_10.txt ├── board_11.txt ├── board_12.txt ├── board_13.txt ├── board_14.txt ├── board_15.txt ├── board_16.txt ├── board_17.txt ├── board_18.txt ├── board_19.txt ├── board_2.txt ├── board_20.txt ├── board_21.txt ├── board_22.txt ├── board_23.txt ├── board_24.txt ├── board_25.txt ├── board_26.txt ├── board_27.txt ├── board_28.txt ├── board_29.txt ├── board_3.txt ├── board_38.txt ├── board_39.txt ├── board_4.txt ├── board_40.txt ├── board_41.txt ├── board_48.txt ├── board_49.txt ├── board_5.txt ├── board_52.txt ├── board_53.txt ├── board_56.txt ├── board_57.txt ├── board_6.txt ├── board_7.txt ├── board_8.txt ├── board_9.txt ├── board_30.txt ├── board_31.txt ├── board_32.txt ├── board_33.txt ├── board_34.txt ├── board_35.txt ├── board_36.txt ├── board_37.txt ├── board_42.txt ├── board_43.txt ├── board_44.txt ├── board_45.txt ├── board_46.txt ├── board_47.txt ├── board_50.txt ├── board_51.txt ├── board_54.txt ├── board_55.txt ├── board_58.txt ├── board_59.txt ├── board_60.txt ├── board_61.txt ├── board_62.txt ├── board_63.txt ├── board_64.txt └── board_65.txt ├── src ├── graphics │ ├── opengl.fwd.h │ ├── shader.h │ ├── opengl.h │ └── shader.cpp ├── mcts_network │ ├── tree.fwd.h │ ├── decider.fwd.h │ ├── network.fwd.h │ ├── decider.h │ ├── decider.cpp │ └── tree.h ├── main │ ├── run_game.h │ ├── network │ │ ├── train.h │ │ ├── make_cases.h │ │ ├── train.cpp │ │ └── make_cases.cpp │ ├── run_game.cpp │ └── initialization.h ├── util │ ├── string_util.h │ ├── thread_util.h │ ├── assert_util.h │ ├── string_util.cpp │ ├── thread_util.cpp │ ├── math_util.h │ └── math_util.cpp ├── chess │ └── game.fwd.h └── player │ └── player.fwd.h └── CMakeLists.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /network_dump/placeholder.txt: -------------------------------------------------------------------------------- 1 | Github doesn't support empty folders! -------------------------------------------------------------------------------- /game_state/training_case/placeholder.txt: -------------------------------------------------------------------------------- 1 | Github doesn't support empty folders! -------------------------------------------------------------------------------- /assets/git readme image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/git readme image.png -------------------------------------------------------------------------------- /assets/2D/piece/black_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_king.png -------------------------------------------------------------------------------- /assets/2D/piece/black_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/black_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/black_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/transparent.png -------------------------------------------------------------------------------- /assets/2D/piece/white_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_king.png -------------------------------------------------------------------------------- /assets/2D/piece/white_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/white_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/white_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_king.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/0-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-transparent.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_king.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_king.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/1-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-transparent.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_king.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_king.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_pawn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_pawn.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_queen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_queen.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_rook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_rook.png -------------------------------------------------------------------------------- /assets/2D/piece/black_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/black_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/black_knight.png -------------------------------------------------------------------------------- /assets/2D/piece/white_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/white_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/white_knight.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/1-1.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/1-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/1-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/1-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/2-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/2-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/2-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/3-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/3-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/3-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/3-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/selected/4-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/selected/4-4.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/0-black_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-black_knight.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/0-white_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/0-white_knight.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/1-black_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-black_knight.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_bishop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_bishop.png -------------------------------------------------------------------------------- /assets/2D/piece/1-white_knight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/piece/1-white_knight.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/1-1.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/1-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/1-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/1-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/2-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/2-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/2-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/3-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/3-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/3-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/3-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/normal_move/4-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/normal_move/4-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/1-1.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/1-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/1-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/1-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/2-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/2-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/2-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/3-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/3-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/3-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/3-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/attacking_move/4-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/attacking_move/4-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/originals/selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/originals/selected.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/1-1.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/1-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/1-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/1-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/2-2.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/2-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/2-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/3-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/3-3.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/3-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/3-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/previous_move/4-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/previous_move/4-4.png -------------------------------------------------------------------------------- /assets/2D/overlay/originals/normal_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/originals/normal_move.png -------------------------------------------------------------------------------- /assets/2D/overlay/originals/attacking_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/originals/attacking_move.png -------------------------------------------------------------------------------- /assets/2D/overlay/originals/previous_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/utk003/Chess-AI/HEAD/assets/2D/overlay/originals/previous_move.png -------------------------------------------------------------------------------- /shaders/fragment_shader.fs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | in vec2 outTexCoord; 4 | out vec4 color; 5 | 6 | uniform sampler2D texture_sampler; 7 | 8 | void main() { 9 | color = texture(texture_sampler, outTexCoord); 10 | } -------------------------------------------------------------------------------- /shaders/vertex_shader.vs: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | layout(location = 0) in vec3 vertexPosition_modelspace; 4 | layout(location = 1) in vec2 texCoord; 5 | 6 | out vec2 outTexCoord; 7 | 8 | uniform mat4 MVP; 9 | 10 | void main() { 11 | gl_Position = MVP * vec4(vertexPosition_modelspace, 1.0f); 12 | outTexCoord = texCoord; 13 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Utkarsh Priyam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /training_cases/board_0.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0 67 | -------------------------------------------------------------------------------- /training_cases/board_1.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0 67 | -------------------------------------------------------------------------------- /assets/game_states/chess_default_start.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -------------------------------------------------------------------------------- /training_cases/board_10.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - none none . 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - pawn white false 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.13466579036937262 67 | -------------------------------------------------------------------------------- /training_cases/board_11.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - none none . 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - pawn white false 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.13466579036937262 67 | -------------------------------------------------------------------------------- /training_cases/board_12.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - none none . 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - pawn white false 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.26933158073874525 67 | -------------------------------------------------------------------------------- /training_cases/board_13.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - none none . 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - pawn white false 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.26933158073874525 67 | -------------------------------------------------------------------------------- /training_cases/board_14.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - none none . 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - pawn white false 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.23471021784286636 67 | -------------------------------------------------------------------------------- /training_cases/board_15.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - none none . 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - pawn white false 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.23471021784286636 67 | -------------------------------------------------------------------------------- /training_cases/board_16.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - none none . 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - pawn white false 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.4694204356857327 67 | -------------------------------------------------------------------------------- /training_cases/board_17.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - none none . 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - pawn white false 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.4694204356857327 67 | -------------------------------------------------------------------------------- /training_cases/board_18.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - none none . 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - pawn white false 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.26229314406795995 67 | -------------------------------------------------------------------------------- /training_cases/board_19.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - none none . 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - pawn white false 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.26229314406795995 67 | -------------------------------------------------------------------------------- /training_cases/board_2.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - none none . 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - pawn white false 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.011685533662379032 67 | -------------------------------------------------------------------------------- /training_cases/board_20.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - none none . 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - pawn white false 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.5245862881359199 67 | -------------------------------------------------------------------------------- /training_cases/board_21.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - none none . 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - pawn white false 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.5245862881359199 67 | -------------------------------------------------------------------------------- /training_cases/board_22.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - none none . 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - pawn white false 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.18794125027353506 67 | -------------------------------------------------------------------------------- /training_cases/board_23.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - none none . 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - pawn white false 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.18794125027353506 67 | -------------------------------------------------------------------------------- /training_cases/board_24.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - none none . 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - pawn white false 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.3758825005470701 67 | -------------------------------------------------------------------------------- /training_cases/board_25.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - none none . 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - pawn white false 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.3758825005470701 67 | -------------------------------------------------------------------------------- /training_cases/board_26.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - none none . 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - pawn white false 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.08634506377726117 67 | -------------------------------------------------------------------------------- /training_cases/board_27.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - none none . 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - pawn white false 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.08634506377726117 67 | -------------------------------------------------------------------------------- /training_cases/board_28.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - none none . 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - pawn white false 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.17269012755452234 67 | -------------------------------------------------------------------------------- /training_cases/board_29.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - none none . 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - pawn white false 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.17269012755452234 67 | -------------------------------------------------------------------------------- /training_cases/board_3.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - none none . 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - pawn white false 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.011685533662379032 67 | -------------------------------------------------------------------------------- /training_cases/board_38.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - pawn black false 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - none none . 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.0495407757059954 67 | -------------------------------------------------------------------------------- /training_cases/board_39.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - pawn black false 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - none none . 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.0495407757059954 67 | -------------------------------------------------------------------------------- /training_cases/board_4.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - none none . 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - pawn white false 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.023371067324758063 67 | -------------------------------------------------------------------------------- /training_cases/board_40.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - pawn black false 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - none none . 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.0990815514119908 67 | -------------------------------------------------------------------------------- /training_cases/board_41.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - pawn black false 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - none none . 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.0990815514119908 67 | -------------------------------------------------------------------------------- /training_cases/board_48.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - pawn black false 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - none none . 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.4694204356857327 67 | -------------------------------------------------------------------------------- /training_cases/board_49.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - pawn black false 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - none none . 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.4694204356857327 67 | -------------------------------------------------------------------------------- /training_cases/board_5.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - none none . 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - pawn white false 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.023371067324758063 67 | -------------------------------------------------------------------------------- /training_cases/board_52.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - pawn black false 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - none none . 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.5245862881359199 67 | -------------------------------------------------------------------------------- /training_cases/board_53.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - pawn black false 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - none none . 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.5245862881359199 67 | -------------------------------------------------------------------------------- /training_cases/board_56.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - pawn black false 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - none none . 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.3758825005470701 67 | -------------------------------------------------------------------------------- /training_cases/board_57.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - pawn black false 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - none none . 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.3758825005470701 67 | -------------------------------------------------------------------------------- /training_cases/board_6.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - none none . 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - pawn white false 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0495407757059954 67 | -------------------------------------------------------------------------------- /training_cases/board_7.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - none none . 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - pawn white false 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0495407757059954 67 | -------------------------------------------------------------------------------- /training_cases/board_8.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - none none . 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - pawn white false 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0990815514119908 67 | -------------------------------------------------------------------------------- /training_cases/board_9.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - none none . 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - pawn white false 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.0990815514119908 67 | -------------------------------------------------------------------------------- /training_cases/board_30.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - none none . 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - pawn white false 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.025435082337611978 67 | -------------------------------------------------------------------------------- /training_cases/board_31.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - none none . 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - pawn white false 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.025435082337611978 67 | -------------------------------------------------------------------------------- /training_cases/board_32.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - none none . 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - pawn white false 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.050870164675223956 67 | -------------------------------------------------------------------------------- /training_cases/board_33.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - none none . 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - pawn white false 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | 0.050870164675223956 67 | -------------------------------------------------------------------------------- /training_cases/board_34.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - pawn black false 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - none none . 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.011685533662379032 67 | -------------------------------------------------------------------------------- /training_cases/board_35.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - pawn black false 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - none none . 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.011685533662379032 67 | -------------------------------------------------------------------------------- /training_cases/board_36.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - pawn black false 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - none none . 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.023371067324758063 67 | -------------------------------------------------------------------------------- /training_cases/board_37.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - pawn black false 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - none none . 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.023371067324758063 67 | -------------------------------------------------------------------------------- /training_cases/board_42.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - pawn black false 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - none none . 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.13466579036937262 67 | -------------------------------------------------------------------------------- /training_cases/board_43.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - pawn black false 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - none none . 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.13466579036937262 67 | -------------------------------------------------------------------------------- /training_cases/board_44.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - pawn black false 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - none none . 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.26933158073874525 67 | -------------------------------------------------------------------------------- /training_cases/board_45.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - pawn black false 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - none none . 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.26933158073874525 67 | -------------------------------------------------------------------------------- /training_cases/board_46.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - pawn black false 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - none none . 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.23471021784286636 67 | -------------------------------------------------------------------------------- /training_cases/board_47.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - pawn black false 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - none none . 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.23471021784286636 67 | -------------------------------------------------------------------------------- /training_cases/board_50.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - pawn black false 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - none none . 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.26229314406795995 67 | -------------------------------------------------------------------------------- /training_cases/board_51.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - pawn black false 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - none none . 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.26229314406795995 67 | -------------------------------------------------------------------------------- /training_cases/board_54.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - pawn black false 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - none none . 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.18794125027353506 67 | -------------------------------------------------------------------------------- /training_cases/board_55.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - pawn black false 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - none none . 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.18794125027353506 67 | -------------------------------------------------------------------------------- /training_cases/board_58.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - pawn black false 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - none none . 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.08634506377726117 67 | -------------------------------------------------------------------------------- /training_cases/board_59.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - pawn black false 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - none none . 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.08634506377726117 67 | -------------------------------------------------------------------------------- /training_cases/board_60.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - pawn black false 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - none none . 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.17269012755452234 67 | -------------------------------------------------------------------------------- /training_cases/board_61.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - pawn black false 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - none none . 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.17269012755452234 67 | -------------------------------------------------------------------------------- /training_cases/board_62.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - pawn black false 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - none none . 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.025435082337611978 67 | -------------------------------------------------------------------------------- /training_cases/board_63.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - pawn black false 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - none none . 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.025435082337611978 67 | -------------------------------------------------------------------------------- /training_cases/board_64.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - queen white . 6 | 4 - king white false 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - none none . 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - pawn black false 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - pawn black false 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - none none . 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - queen black . 62 | 60 - king black false 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.050870164675223956 67 | -------------------------------------------------------------------------------- /training_cases/board_65.txt: -------------------------------------------------------------------------------- 1 | 8 8 2 | 0 - rook white false 3 | 1 - knight white . 4 | 2 - bishop white . 5 | 3 - king white false 6 | 4 - queen white . 7 | 5 - bishop white . 8 | 6 - knight white . 9 | 7 - rook white false 10 | 8 - pawn white false 11 | 9 - pawn white false 12 | 10 - pawn white false 13 | 11 - pawn white false 14 | 12 - pawn white false 15 | 13 - pawn white false 16 | 14 - pawn white false 17 | 15 - pawn white false 18 | 16 - none none . 19 | 17 - none none . 20 | 18 - none none . 21 | 19 - none none . 22 | 20 - none none . 23 | 21 - none none . 24 | 22 - none none . 25 | 23 - none none . 26 | 24 - none none . 27 | 25 - none none . 28 | 26 - none none . 29 | 27 - none none . 30 | 28 - none none . 31 | 29 - none none . 32 | 30 - none none . 33 | 31 - none none . 34 | 32 - pawn black false 35 | 33 - none none . 36 | 34 - none none . 37 | 35 - none none . 38 | 36 - none none . 39 | 37 - none none . 40 | 38 - none none . 41 | 39 - none none . 42 | 40 - none none . 43 | 41 - none none . 44 | 42 - none none . 45 | 43 - none none . 46 | 44 - none none . 47 | 45 - none none . 48 | 46 - none none . 49 | 47 - none none . 50 | 48 - none none . 51 | 49 - pawn black false 52 | 50 - pawn black false 53 | 51 - pawn black false 54 | 52 - pawn black false 55 | 53 - pawn black false 56 | 54 - pawn black false 57 | 55 - pawn black false 58 | 56 - rook black false 59 | 57 - knight black . 60 | 58 - bishop black . 61 | 59 - king black false 62 | 60 - queen black . 63 | 61 - bishop black . 64 | 62 - knight black . 65 | 63 - rook black false 66 | -0.050870164675223956 67 | -------------------------------------------------------------------------------- /src/graphics/opengl.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_GRAPHICS_OPENGL_FWD_H_ 26 | #define CHESS_AI_GRAPHICS_OPENGL_FWD_H_ 27 | 28 | namespace graphics { 29 | 30 | class OpenGL; 31 | 32 | } 33 | 34 | #endif // CHESS_AI_GRAPHICS_OPENGL_FWD_H_ 35 | -------------------------------------------------------------------------------- /src/mcts_network/tree.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MCTS_NETWORK_TREE_FWD_H_ 26 | #define CHESS_AI_MCTS_NETWORK_TREE_FWD_H_ 27 | 28 | namespace tree { 29 | 30 | class Node; 31 | class MCTS; 32 | 33 | } 34 | 35 | #endif // CHESS_AI_MCTS_NETWORK_TREE_FWD_H_ -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) # CMake version check 2 | project(Chess_AI) # Project name is "Chess_AI" 3 | set(CMAKE_CXX_STANDARD 17) # Using c++17 4 | 5 | # src directory 6 | set(MAIN_DIR src/main.cpp src/main/initialization.cpp src/main/run_game.cpp src/main/network/make_cases.cpp src/main/network/train.cpp) 7 | set(GAME_DIR src/chess/piece.cpp src/chess/game.cpp) 8 | set(GRAPHICS_DIR src/graphics/opengl.cpp src/graphics/shader.cpp) 9 | set(MCTS_NETWORK_DIR src/mcts_network/decider.cpp src/mcts_network/network.cpp src/mcts_network/tree.cpp) 10 | set(PLAYERS_DIR src/player/player.cpp) 11 | set(UTIL_DIR src/util/math_util.cpp src/util/string_util.cpp src/util/thread_util.cpp src/util/assert_util.cpp) 12 | 13 | # get all program dependencies 14 | find_package(PkgConfig REQUIRED) 15 | pkg_search_module(GLFW REQUIRED glfw3) 16 | pkg_search_module(GLEW REQUIRED glew) 17 | pkg_search_module(GSL REQUIRED gsl) 18 | pkg_search_module(GLM glm) 19 | 20 | if (NOT GLM_FOUND EQUAL 1) 21 | if (APPLE) 22 | set(GLM_PATH /usr/local/include) 23 | else () 24 | set(GLM_PATH /usr/include) 25 | endif () 26 | find_path(GLM_PATH glm/glm.h) 27 | set(GLM_INCLUDE_DIRS ${GLM_PATH}) 28 | endif () 29 | 30 | # get library binaries/get headers for dependencies 31 | include_directories(libraries/include ${GLFW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${GLM_INCLUDE_DIRS}) 32 | link_directories(libraries ${GLFW_LIBRARY_DIRS} ${GLEW_LIBRARY_DIRS} ${GSL_LIBRARY_DIRS}) 33 | 34 | # create executable 35 | add_executable(Chess_AI ${MAIN_DIR} ${GAME_DIR} ${GRAPHICS_DIR} ${MCTS_NETWORK_DIR} ${PLAYERS_DIR} ${UTIL_DIR}) 36 | 37 | # link headers for dependencies 38 | target_link_libraries(Chess_AI ${GLFW_LIBRARIES} ${GLEW_LIBRARIES} ${GSL_LIBRARIES}) 39 | 40 | # system-specific settings 41 | if (APPLE) 42 | target_link_libraries(Chess_AI "-framework Cocoa -framework OpenGL -framework IOKit") # needed for static glfw library binary on OSX 43 | elseif (UNIX) 44 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -rdynamic") # needed for multithreading/stack tracing 45 | endif () 46 | 47 | # Debug/Release Macros 48 | #if (CMAKE_BUILD_TYPE MATCHES Debug) 49 | target_compile_definitions(Chess_AI PUBLIC DEBUG) 50 | #endif () -------------------------------------------------------------------------------- /src/mcts_network/decider.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MCTS_NETWORK_DECIDER_FWD_H_ 26 | #define CHESS_AI_MCTS_NETWORK_DECIDER_FWD_H_ 27 | 28 | namespace decider { 29 | 30 | class Decider; 31 | class Randomizer; 32 | class Minimaxer; 33 | 34 | } 35 | 36 | #endif // CHESS_AI_MCTS_NETWORK_DECIDER_FWD_H_ -------------------------------------------------------------------------------- /src/graphics/shader.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_GRAPHICS_UTIL_SHADER_H_ 26 | #define CHESS_AI_GRAPHICS_UTIL_SHADER_H_ 27 | 28 | #include 29 | 30 | namespace graphics { 31 | 32 | GLuint loadShaders(const char *vertex_file_path, const char *fragment_file_path); 33 | 34 | } 35 | 36 | #endif // CHESS_AI_GRAPHICS_UTIL_SHADER_H_ -------------------------------------------------------------------------------- /src/mcts_network/network.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MCTS_NETWORK_NETWORK_FWD_H_ 26 | #define CHESS_AI_MCTS_NETWORK_NETWORK_FWD_H_ 27 | 28 | namespace network { 29 | 30 | class Network; 31 | class NetworkManager; 32 | 33 | class Optimizer; 34 | 35 | class NetworkStorage; 36 | 37 | } 38 | 39 | #endif // CHESS_AI_MCTS_NETWORK_NETWORK_FWD_H_ -------------------------------------------------------------------------------- /src/main/run_game.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MAIN_RUN_GAME_H_ 26 | #define CHESS_AI_MAIN_RUN_GAME_H_ 27 | 28 | #include 29 | 30 | #include "../player/player.fwd.h" 31 | #include "../chess/game.fwd.h" 32 | 33 | namespace game { 34 | 35 | game::GameResult run_game(player::PlayerType white, player::PlayerType black, bool run_graphics = false, 36 | const std::string &default_board_file_path = "assets/game_states/chess_default_start.txt"); 37 | 38 | } 39 | 40 | #endif // CHESS_AI_MAIN_RUN_GAME_H_ 41 | -------------------------------------------------------------------------------- /src/main/network/train.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MAIN_NETWORK_TRAIN_H_ 26 | #define CHESS_AI_MAIN_NETWORK_TRAIN_H_ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include "../initialization.h" 33 | #include "../../mcts_network/network.fwd.h" 34 | 35 | namespace network::train { 36 | 37 | void train_network(const std::vector &training_case_files = {}); 38 | void train_network(const std::vector &training_case_files, Network *net, 39 | const std::function &termination_condition); 40 | 41 | } 42 | 43 | #endif // CHESS_AI_MAIN_NETWORK_TRAIN_H_ 44 | -------------------------------------------------------------------------------- /src/util/string_util.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_UTIL_STRING_UTIL_H_ 26 | #define CHESS_AI_UTIL_STRING_UTIL_H_ 27 | 28 | #include 29 | #include 30 | 31 | namespace string { 32 | 33 | std::string from_bool(bool b); 34 | bool to_bool(const std::string &s); 35 | 36 | std::string from_double(double d); 37 | double to_double(const std::string &s); 38 | 39 | std::string combine(const std::vector &strings, bool space_separated = false); 40 | 41 | inline bool startsWith(const std::string &str, const std::string &start) { 42 | return str.substr(0, start.length()) == start; 43 | } 44 | inline bool endsWith(const std::string &str, const std::string &end) { 45 | return str.substr(str.length() - end.length()) == end; 46 | } 47 | 48 | } 49 | 50 | #endif // CHESS_AI_UTIL_STRING_UTIL_H_ 51 | -------------------------------------------------------------------------------- /src/util/thread_util.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_UTIL_THREAD_UTIL_H_ 26 | #define CHESS_AI_UTIL_THREAD_UTIL_H_ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | namespace thread { 33 | 34 | void sleep_seconds(int seconds); 35 | void sleep_minutes(int minutes); 36 | void sleep_millis(int milli); 37 | 38 | void sleep(int seconds); 39 | 40 | void wait_for(const bool &exit_condition); 41 | void wait_for(const std::function &exit_condition); 42 | 43 | void wait_for_timeout(const bool &exit_condition, int timeout_seconds); 44 | void wait_for_timeout(const std::function &exit_condition, int timeout_seconds); 45 | 46 | void do_while_waiting_for(const std::function &to_do, const bool &exit_condition); 47 | void do_while_waiting_for(const std::function &to_do, const std::function &exit_condition); 48 | 49 | template 50 | inline void create(Fn &&fn, Args &&... args) { 51 | std::thread(fn, args...).detach(); 52 | } 53 | 54 | } 55 | 56 | #endif // CHESS_AI_UTIL_THREAD_UTIL_H_ 57 | -------------------------------------------------------------------------------- /src/util/assert_util.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_UTIL_ASSERT_UTIL_H_ 26 | #define CHESS_AI_UTIL_ASSERT_UTIL_H_ 27 | 28 | #ifdef DEBUG 29 | # include 30 | void printstacktracehelper(std::ostream &out, int depth); 31 | # define print_stack_trace() printstacktracehelper(std::cerr, 25) // debugging tool 32 | # 33 | # undef NDEBUG // allow assert() 34 | # include 35 | # define FATAL_ASSERT { assert(false); } // macro to kill program during debug AND release 36 | # define DEBUG_ASSERT { printstacktracehelper(std::cerr, 25); assert(false); } // macro to kill program only during debug 37 | // if DEBUG is defined -> Debug Mode 38 | 39 | #else 40 | # define print_stack_trace() // debugging tool 41 | # define FATAL_ASSERT { __builtin_unreachable(); exit(-1); } // macro to kill program during debug AND release 42 | # define DEBUG_ASSERT {} // macro to kill program only during debug 43 | // else DEBUG is not defined -> Release/Testing/Production Mode 44 | 45 | #endif 46 | // end DEBUG if/else statement 47 | 48 | #endif // CHESS_AI_UTIL_ASSERT_UTIL_H_ 49 | -------------------------------------------------------------------------------- /src/main/network/make_cases.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MAIN_NETWORK_MAKE_CASES_H_ 26 | #define CHESS_AI_MAIN_NETWORK_MAKE_CASES_H_ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "../initialization.h" 34 | #include "../../chess/game.fwd.h" 35 | 36 | namespace network { 37 | 38 | static std::vector> training_boards; 39 | extern std::atomic_bool save_network; 40 | 41 | void generate_training_cases(std::vector &file_paths, int &sim_count, int num_simulations = 1); 42 | void generate_training_cases(const std::function &termination_condition, 43 | std::vector &file_paths, 44 | int &sim_count, int num_simulations = 1); 45 | 46 | std::string save_training_case(const std::string &case_index, const std::pair &training_case); 47 | std::pair load_training_case(const std::string &file_path, bool pad_file_path = true); 48 | 49 | } 50 | 51 | #endif // CHESS_AI_MAIN_NETWORK_MAKE_CASES_H_ 52 | -------------------------------------------------------------------------------- /src/util/string_util.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "string_util.h" 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | std::string string::from_bool(bool b) { 32 | return b ? "true": "false"; 33 | } 34 | 35 | bool string::to_bool(const std::string &s) { 36 | return s == "true"; 37 | } 38 | 39 | std::string string::from_double(double d) { 40 | std::stringstream ss; 41 | ss << std::setprecision(std::numeric_limits::max_digits10) << std::scientific << d; 42 | return ss.str(); 43 | } 44 | 45 | double string::to_double(const std::string &s) { 46 | double d; 47 | 48 | std::stringstream ss; 49 | ss << s; 50 | ss >> d; 51 | 52 | return d; 53 | } 54 | 55 | std::string string::combine(const std::vector &strings, bool space_separated) { 56 | if (strings.empty()) 57 | return ""; 58 | 59 | std::string str; 60 | if (space_separated) { 61 | for (const auto &s: strings) { 62 | str += " "; 63 | str += s; 64 | } 65 | str = str.substr(1); 66 | } else 67 | for (const auto &s: strings) 68 | str += s; 69 | 70 | return str; 71 | } -------------------------------------------------------------------------------- /src/main/run_game.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "run_game.h" 26 | 27 | #include "initialization.h" 28 | 29 | #include "../graphics/opengl.h" 30 | #include "../util/thread_util.h" 31 | 32 | game::GameResult game::run_game(player::PlayerType white, player::PlayerType black, bool run_graphics, 33 | const std::string &default_board_file_path) { 34 | auto *game = new game::Game(new game::Board(8, 8)); 35 | game->board()->loadFromFile(default_board_file_path); 36 | 37 | game->setPlayer(piece::PieceColor::WHITE, white); 38 | game->setPlayer(piece::PieceColor::BLACK, black); 39 | 40 | if (run_graphics) { 41 | // start graphics engine 42 | graphics::OpenGL *openGL = graphics::OpenGL::get_instance(game, "Chess"); 43 | // start game 44 | game->startGame(); 45 | // run graphics 46 | openGL->run(); 47 | // once graphics closes, delete graphics engine 48 | delete openGL; 49 | } else { 50 | game->startGame(); 51 | thread::wait_for([&] { return game->isOver(); }); 52 | } 53 | game::GameResult result = game->getResult(); 54 | 55 | // tell game to terminate 56 | game->endGame(); 57 | // wait for game to finish processes, then delete game 58 | game->waitForDelete(); 59 | delete game; 60 | 61 | return result; 62 | } -------------------------------------------------------------------------------- /src/main/initialization.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MAIN_INITIALIZATION_H_ 26 | #define CHESS_AI_MAIN_INITIALIZATION_H_ 27 | 28 | #include 29 | #include 30 | 31 | #include "../mcts_network/network.h" 32 | 33 | namespace settings { 34 | 35 | extern bool PRINT_INITIALIZATION_DEBUG_INFORMATION; 36 | extern bool PRINT_GAME_SIMULATION_DEBUG_INFORMATION; 37 | 38 | extern int GAMES_PER_NETWORK_SAVE; 39 | extern std::function TRAINING_TERMINATION_CONDITION; 40 | 41 | extern std::function> &, game::Board *, double)> 42 | SIMULATION_BOARD_SAVE_PROCEDURE; 43 | 44 | } 45 | 46 | namespace init { 47 | 48 | void initializeRNG(const std::string &rng_seed = ""); 49 | 50 | void updateWorkingDirectory(const std::string &target_dir = "Chess-AI"); 51 | void 52 | updateMCTSParameters(double thread_usage_ratio = 1.0, int simulation_move_depth = 8, int simulations_per_thread = 125); 53 | void updateNetworkSettings(bool load_prev_network = true, bool save_networks = true, 54 | const std::string &network_file_path = network::NetworkStorage::LATEST_NETWORK_FILE_PATH); 55 | void updateTrainingParameters(const std::function &termination_condition = [] { return true; }, 56 | int network_save_interval_in_games = 20, double ratio_of_training_boards_to_save = 1.0); 57 | 58 | bool verify(bool is_fatal_if_fail = false); 59 | 60 | } 61 | 62 | #endif // CHESS_AI_MAIN_INITIALIZATION_H_ 63 | -------------------------------------------------------------------------------- /src/util/thread_util.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "thread_util.h" 26 | 27 | void thread::sleep_seconds(int seconds) { std::this_thread::sleep_for(std::chrono::seconds(seconds)); } 28 | void thread::sleep_minutes(int minutes) { std::this_thread::sleep_for(std::chrono::minutes(minutes)); } 29 | void thread::sleep_millis(int milli) { std::this_thread::sleep_for(std::chrono::milliseconds(milli)); } 30 | 31 | void thread::sleep(int seconds) { sleep_seconds(seconds); } 32 | 33 | void thread::wait_for(const bool &exit_condition) { 34 | do_while_waiting_for([] {}, exit_condition); 35 | } 36 | 37 | void thread::wait_for(const std::function &exit_condition) { 38 | do_while_waiting_for([] {}, exit_condition); 39 | } 40 | 41 | void thread::wait_for_timeout(const bool &exit_condition, int timeout_seconds) { 42 | wait_for_timeout([&] { return exit_condition; }, timeout_seconds); 43 | } 44 | 45 | void thread::wait_for_timeout(const std::function &exit_condition, int timeout_seconds) { 46 | int counter = timeout_seconds * 1000; 47 | do_while_waiting_for([] {}, [&] { return exit_condition() || counter-- < 0; }); 48 | } 49 | 50 | void thread::do_while_waiting_for(const std::function &to_do, const bool &exit_condition) { 51 | do_while_waiting_for(to_do, [&] { return exit_condition; }); 52 | } 53 | void thread::do_while_waiting_for(const std::function &to_do, const std::function &exit_condition) { 54 | while (!exit_condition()) { 55 | to_do(); 56 | sleep_millis(1); 57 | } 58 | } -------------------------------------------------------------------------------- /src/util/math_util.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_UTIL_MATH_UTIL_H_ 26 | #define CHESS_AI_UTIL_MATH_UTIL_H_ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | 33 | namespace math { 34 | 35 | static std::mt19937 mersenne_twister_32bit_randomizer; 36 | static std::uniform_real_distribution rng_distribution{0.0, 1.0}; 37 | 38 | template 39 | inline constexpr 40 | int signum(T x, std::false_type is_signed) { 41 | return T(0) < x; 42 | } 43 | 44 | template 45 | inline constexpr 46 | int signum(T x, std::true_type is_signed) { 47 | return (T(0) < x) - (x < T(0)); 48 | } 49 | 50 | template 51 | inline constexpr 52 | int signum(T x) { 53 | return signum(x, std::is_signed()); 54 | } 55 | 56 | template 57 | inline constexpr 58 | int sgn(T x) { 59 | return signum(x); 60 | } 61 | 62 | // [lower, upper) 63 | double random(double lower, double upper); 64 | // [0.0, upper) 65 | double random(double upper); 66 | // [0.0, 1.0) 67 | double random(); 68 | 69 | // [lower, upper) 70 | float random(float lower, float upper); 71 | // [0.0f, upper) 72 | float random(float upper); 73 | 74 | // [min,max] 75 | int random(int min, int max); 76 | // [0, size-1] 77 | int random(int size); 78 | 79 | // clamp x to [range.first, range.second] 80 | void clamp(double &x, std::pair range); 81 | void clamp(float &x, std::pair range); 82 | 83 | // true with probability p 84 | bool chance(double p); 85 | 86 | } 87 | 88 | #endif // CHESS_AI_UTIL_MATH_UTIL_H_ 89 | -------------------------------------------------------------------------------- /src/mcts_network/decider.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MCTS_NETWORK_DECIDER_H_ 26 | #define CHESS_AI_MCTS_NETWORK_DECIDER_H_ 27 | 28 | #include "decider.fwd.h" 29 | 30 | #include 31 | #include 32 | 33 | #include "../chess/piece.fwd.h" 34 | #include "../chess/game.fwd.h" 35 | #include "../util/math_util.h" 36 | 37 | namespace decider { 38 | 39 | class Decider { 40 | public: 41 | Decider(const Decider &d) = delete; 42 | Decider &operator=(const Decider &d) = delete; 43 | 44 | virtual std::pair> prediction(game::Game *game); 45 | virtual ~Decider() = default; // Do nothing 46 | 47 | protected: 48 | Decider() = default; 49 | 50 | // Random numbers from [a,b) 51 | static inline double random(double a, double b) { return math::random(a, b); } 52 | 53 | virtual double predictPosition(game::Board *b) = 0; 54 | }; 55 | 56 | class Randomizer : public Decider { 57 | public: 58 | Randomizer() = default; 59 | Randomizer(const Randomizer &d) = delete; 60 | Randomizer &operator=(const Randomizer &d) = delete; 61 | 62 | ~Randomizer() override = default; // Do nothing 63 | 64 | protected: 65 | double predictPosition(game::Board *b) override; 66 | }; 67 | 68 | class Minimaxer : public Decider { 69 | public: 70 | Minimaxer() = default; 71 | Minimaxer(const Randomizer &d) = delete; 72 | Minimaxer &operator=(const Randomizer &d) = delete; 73 | 74 | ~Minimaxer() override = default; // Do nothing 75 | 76 | protected: 77 | double predictPosition(game::Board *b) override; 78 | }; 79 | 80 | } 81 | 82 | #endif // CHESS_AI_MCTS_NETWORK_DECIDER_H_ -------------------------------------------------------------------------------- /src/mcts_network/decider.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "decider.h" 26 | 27 | #include "../chess/game.h" 28 | #include 29 | 30 | // Decider class 31 | std::pair> decider::Decider::prediction(game::Game *game) { 32 | game::Board *board = game->board(); 33 | 34 | piece::PieceColor current_color = game->getCurrentColor(); 35 | double color_multiplier = current_color.value(); 36 | 37 | double currEval = color_multiplier * predictPosition(board); 38 | 39 | std::map actionMap; 40 | std::vector moves = game->possibleMoves(current_color); 41 | std::vector temp_vec; 42 | 43 | for (auto &move : moves) 44 | if (move.verify(board)) { 45 | board->doMove(new game::Move(move), game); 46 | 47 | if (current_color.isWhite()) 48 | board->getPossibleMoves(nullptr, &temp_vec); 49 | else 50 | board->getPossibleMoves(&temp_vec, nullptr); 51 | 52 | if (temp_vec.empty()) 53 | actionMap[move] = color_multiplier * predictPosition(board); 54 | else { 55 | actionMap[move] = color_multiplier * 20.0; 56 | temp_vec.clear(); 57 | } 58 | board->undoMove(game); 59 | } else DEBUG_ASSERT 60 | 61 | return {currEval, actionMap}; 62 | } 63 | 64 | // Randomizer class 65 | double decider::Randomizer::predictPosition(game::Board *b) { 66 | double range = 4.0; 67 | return random(-range, range); 68 | } 69 | 70 | // Minimaxer class 71 | double decider::Minimaxer::predictPosition(game::Board *b) { 72 | return b->score( 73 | [&](piece::Piece *piece, int r, int c) -> double { 74 | return piece->color().value() * piece->type().minimaxValue();//r, c, piece->color()); 75 | } 76 | ); 77 | } -------------------------------------------------------------------------------- /src/main/network/train.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "train.h" 26 | 27 | #include 28 | #include 29 | 30 | #include "make_cases.h" 31 | #include "../../util/string_util.h" 32 | #include "../../util/thread_util.h" 33 | 34 | void network::train::train_network(const std::vector &training_case_files) { 35 | train_network(training_case_files, network::NetworkStorage::current_network(), 36 | settings::TRAINING_TERMINATION_CONDITION); 37 | } 38 | 39 | void network::train::train_network(const std::vector &training_case_files, Network *net, 40 | const std::function &termination_condition) { 41 | const int NUM_CASES_PER_SAVE = settings::GAMES_PER_NETWORK_SAVE; 42 | const double LAMBDA_MIN = 0.0001, LAMBDA_MAX = 10.0, DEFAULT_LAMBDA = Optimizer::DEFAULT_INITIAL_LAMBDA; 43 | 44 | double lambda = DEFAULT_LAMBDA; 45 | int case_counter = 0; 46 | 47 | while (!termination_condition()) 48 | if (!training_case_files.empty()) { 49 | const std::string &file_path = training_case_files[math::random((int) training_case_files.size())]; 50 | auto training_case = load_training_case(file_path, !string::endsWith(file_path, ".txt")); 51 | Optimizer::optimize(net, training_case.first, training_case.second, lambda); 52 | delete training_case.first; 53 | 54 | if (lambda < LAMBDA_MIN || LAMBDA_MAX < lambda) { 55 | lambda = DEFAULT_LAMBDA; 56 | Optimizer::dropout(net); 57 | } 58 | if (++case_counter >= NUM_CASES_PER_SAVE) { 59 | if (save_network) { 60 | save_network.store(false); 61 | network::NetworkStorage::saveNetwork(); 62 | } 63 | 64 | case_counter = 0; 65 | } 66 | } else 67 | thread::sleep_millis(1); 68 | } -------------------------------------------------------------------------------- /src/util/math_util.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "math_util.h" 26 | 27 | #include 28 | 29 | #include "assert_util.h" 30 | 31 | // [lower, upper) 32 | double math::random(double lower, double upper) { 33 | return (upper - lower) * rng_distribution(mersenne_twister_32bit_randomizer) + lower; 34 | } 35 | // [0.0, upper) 36 | double math::random(double upper) { return random(0.0, upper); } 37 | // [0.0, 1.0) 38 | double math::random() { return random(0.0, 1.0); } 39 | 40 | // [lower, upper) 41 | float math::random(float lower, float upper) { 42 | return (float) random((double) lower, (double) upper); 43 | } 44 | // [0.0f, upper) 45 | float math::random(float upper) { return random(0.0f, upper); } 46 | 47 | // [min,max] 48 | int math::random(int min, int max) { 49 | return (int) random((double) min, (double) max + 1.0); 50 | } 51 | // [0, size-1] 52 | int math::random(int size) { return random(0, size - 1); } 53 | 54 | // clamp x to [range.first, range.second] 55 | void math::clamp(double &x, std::pair range) { 56 | if (range.first > range.second) { 57 | DEBUG_ASSERT 58 | double temp = range.first; 59 | range.first = range.second; 60 | range.second = temp; 61 | } 62 | 63 | if (x < range.first) 64 | x = range.first; 65 | else if (x > range.second) 66 | x = range.second; 67 | } 68 | void math::clamp(float &x, std::pair range) { 69 | if (range.first > range.second) { 70 | DEBUG_ASSERT 71 | double temp = range.first; 72 | range.first = range.second; 73 | range.second = temp; 74 | } 75 | 76 | if (x < range.first) 77 | x = range.first; 78 | else if (x > range.second) 79 | x = range.second; 80 | } 81 | 82 | // true with probability p 83 | bool math::chance(double p) { 84 | return random() < p; // don't need to explicitly clamp p to [0.0, 1.0] b/c this will still work 85 | } -------------------------------------------------------------------------------- /src/chess/game.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | // game.fwd.h header guard 26 | #ifndef CHESS_AI_CHESS_GAME_FWD_H_ 27 | #define CHESS_AI_CHESS_GAME_FWD_H_ 28 | 29 | #include 30 | 31 | #include "../util/assert_util.h" 32 | 33 | // The "game" namespace is for all game related classes: 34 | // - Move, Board, Game classes 35 | // - BoardController manager class 36 | namespace game { 37 | 38 | class Board; 39 | class BoardController; 40 | 41 | class Move; 42 | class Game; 43 | 44 | // Game Result "enum" 45 | class GameResult { 46 | public: 47 | enum Result { 48 | BLACK, WHITE, STALEMATE, NONE 49 | }; 50 | 51 | GameResult() = default; 52 | GameResult(Result c) { value = c; } 53 | 54 | constexpr operator Result() const { return value; } 55 | explicit operator bool() = delete; 56 | 57 | constexpr bool operator==(GameResult c) const { return value == c.value; } 58 | constexpr bool operator!=(GameResult c) const { return value != c.value; } 59 | 60 | constexpr bool isWhiteWin() const { return value == WHITE; } 61 | constexpr bool isBlackWin() const { return value == BLACK; } 62 | constexpr bool isStalemate() const { return value == STALEMATE; } 63 | constexpr bool isGameUndecided() const { return value == NONE; } 64 | 65 | std::string toString() const { 66 | switch (value) { 67 | case BLACK: 68 | return "0-1"; 69 | case WHITE: 70 | return "1-0"; 71 | 72 | case STALEMATE: 73 | return "0.5-0.5"; 74 | 75 | case NONE: 76 | return "none"; 77 | 78 | default: FATAL_ASSERT 79 | } 80 | } 81 | 82 | constexpr int evaluate() const { 83 | switch (value) { 84 | case BLACK: 85 | return -1; 86 | case WHITE: 87 | return 1; 88 | 89 | case STALEMATE: 90 | case NONE: 91 | return 0; 92 | 93 | default: FATAL_ASSERT 94 | } 95 | } 96 | 97 | private: 98 | Result value; 99 | }; 100 | 101 | } 102 | 103 | // end game.fwd.h header guard 104 | #endif // CHESS_AI_CHESS_GAME_FWD_H_ -------------------------------------------------------------------------------- /src/player/player.fwd.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_PLAYER_PLAYER_FWD_H_ 26 | #define CHESS_AI_PLAYER_PLAYER_FWD_H_ 27 | 28 | #include 29 | 30 | #include "../chess/piece.fwd.h" 31 | #include "../chess/game.fwd.h" 32 | #include "../util/assert_util.h" 33 | 34 | namespace player { 35 | 36 | class Player; 37 | class HumanPlayer; 38 | class RandomPlayer; 39 | class MinimaxPlayer; 40 | class AlphaBetaPlayer; 41 | class MonteCarloPlayer; 42 | 43 | // Player Type "enum" 44 | class PlayerType { 45 | public: 46 | enum Type { 47 | HUMAN, RANDOM, MINIMAX, AB_PRUNING, MCTS, AI 48 | }; 49 | 50 | PlayerType() = default; 51 | PlayerType(Type t) { value = t; } 52 | 53 | constexpr operator Type() const { return value; } 54 | explicit operator bool() = delete; 55 | 56 | constexpr bool operator==(PlayerType c) const { return value == c.value; } 57 | constexpr bool operator!=(PlayerType c) const { return value != c.value; } 58 | 59 | constexpr bool isHumanPlayer() const { return value == HUMAN; } 60 | constexpr bool isRandomPlayer() const { return value == RANDOM; } 61 | constexpr bool isMinimaxPlayer() const { return value == MINIMAX; } 62 | constexpr bool isAlphaBetaPruningPlayer() const { return value == AB_PRUNING; } 63 | constexpr bool isMonteCarloTreeSearchPlayer() const { return value == MCTS; } 64 | constexpr bool isAIPlayer() const { return value == AI; } 65 | 66 | inline Player *getPlayerOfType(game::Game *game, piece::PieceColor color) const { 67 | return getPlayerOfType(*this, game, color); 68 | } 69 | static Player *getPlayerOfType(PlayerType type, game::Game *game, piece::PieceColor color); 70 | 71 | std::string toString() const { 72 | switch (value) { 73 | case HUMAN: 74 | return "Human Player"; 75 | case RANDOM: 76 | return "Random Player"; 77 | case MINIMAX: 78 | return "Minimax Player"; 79 | case AB_PRUNING: 80 | return "Alpha-Beta Pruning Player"; 81 | case MCTS: 82 | return "Monte Carlo Tree Search Player"; 83 | case AI: 84 | return "AI Network Player"; 85 | 86 | default: FATAL_ASSERT 87 | } 88 | } 89 | 90 | private: 91 | Type value; 92 | }; 93 | 94 | } 95 | 96 | #endif // CHESS_AI_PLAYER_PLAYER_FWD_H_ -------------------------------------------------------------------------------- /src/graphics/opengl.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_GRAPHICS_OPENGL_H_ 26 | #define CHESS_AI_GRAPHICS_OPENGL_H_ 27 | 28 | #include "opengl.fwd.h" 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include "shader.h" 39 | 40 | #include "../chess/piece.fwd.h" 41 | #include "../chess/game.h" 42 | #include "../player/player.h" 43 | 44 | namespace graphics { 45 | 46 | class OpenGL : game::BoardController { 47 | public: 48 | static void run_graphics(game::Game *game, const std::string &game_name); 49 | static OpenGL *get_instance(game::Game *game, const std::string &game_name); 50 | 51 | ~OpenGL(); 52 | 53 | void run(); 54 | 55 | void updateGraphics(game::Board *board); 56 | 57 | private: 58 | static std::map _opengl_map; 59 | 60 | inline const static std::string ASSET_2D_DIRECTORY = "assets/2D/"; 61 | std::string asset_file_path; 62 | 63 | OpenGL(game::Game *g, const std::string &game_name); 64 | void initialize(); 65 | 66 | static GLuint getCoordBuffer(int rInt, int cInt); 67 | static GLuint getTextureBuffer(); 68 | 69 | static void loadTexture(const std::string &fileName, std::map &text_map); 70 | void loadTextures(); 71 | 72 | void renderSquare(int r, int c, GLuint textbuff, const std::string &image_file_path); 73 | void renderOverlays(GLuint textbuff); 74 | 75 | void mouseClicked(GLFWwindow *window, int button, int action, int mods); 76 | inline static void onMouseButtonClick(GLFWwindow *window, int button, int action, int mods) { 77 | _opengl_map[window]->mouseClicked(window, button, action, mods); 78 | } 79 | 80 | void keyboardPressed(GLFWwindow *window, int key, int scancode, int action, int mods); 81 | inline static void onKeyboardKeyPress(GLFWwindow *window, int key, int scancode, int action, int mods) { 82 | _opengl_map[window]->keyboardPressed(window, key, scancode, action, mods); 83 | } 84 | 85 | inline void promotionHelper(piece::PieceType type) { 86 | if (_human_white != nullptr) 87 | _human_white->setPawnUpgradeType(type); 88 | if (_human_black != nullptr) 89 | _human_black->setPawnUpgradeType(type); 90 | } 91 | 92 | bool _show_expanded_ui; 93 | std::vector> _overlays; 94 | 95 | GLFWwindow *_window; 96 | GLuint _shader_programID, _vaoID, _mvp_matrixID, _texture_samplerID; 97 | glm::mat4 _mvp_matrix; 98 | 99 | game::Game *_game; 100 | game::Board *_board; 101 | 102 | game::Board *_temp_board; 103 | void checkBoardUpdate(); 104 | 105 | player::Player *_white; 106 | player::Player *_black; 107 | 108 | player::HumanPlayer *_human_white; 109 | player::HumanPlayer *_human_black; 110 | 111 | std::map _texture_map; 112 | std::string _window_title, _game_name; 113 | 114 | int _file_save_counter; 115 | }; 116 | 117 | } 118 | 119 | #endif // CHESS_AI_GRAPHICS_OPENGL_H_ -------------------------------------------------------------------------------- /src/mcts_network/tree.h: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #ifndef CHESS_AI_MCTS_NETWORK_TREE_H_ 26 | #define CHESS_AI_MCTS_NETWORK_TREE_H_ 27 | 28 | #include "tree.fwd.h" 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "../chess/piece.h" 41 | #include "../chess/game.fwd.h" 42 | #include "decider.fwd.h" 43 | 44 | namespace tree { 45 | 46 | class Node { 47 | public: 48 | Node() = delete; 49 | Node(const Node &n) = delete; 50 | Node &operator=(const Node &n) = delete; 51 | 52 | explicit Node(piece::PieceColor col); // Default priority 0.0 -> for root node only 53 | ~Node(); 54 | 55 | [[nodiscard]] double priority() const; 56 | 57 | void increment_visit_count(); 58 | [[nodiscard]] int visit_count() const; 59 | 60 | void increase_value(double inc); 61 | [[nodiscard]] double value() const; 62 | 63 | piece::PieceColor color_to_play(); 64 | int countChildren(); 65 | 66 | [[nodiscard]] bool expanded() const; 67 | bool expand(const std::map &weights, double sum_weights); 68 | 69 | void addNoise(double frac, const double *noise); 70 | 71 | std::pair selectOptimalMove(const std::function &ranker); 72 | 73 | static Node *combineNodes(const std::vector &nodes, int num_nodes); 74 | 75 | private: 76 | Node(double prior, piece::PieceColor col); 77 | 78 | double _priority; 79 | bool _expanded; 80 | 81 | int _visit_count; 82 | double _value_sum; 83 | 84 | piece::PieceColor _color_to_play; 85 | std::map _children; 86 | }; 87 | 88 | class MCTS { 89 | public: 90 | MCTS() = delete; 91 | MCTS(const MCTS &mcts) = delete; 92 | MCTS &operator=(const MCTS &mcts) = delete; 93 | 94 | static std::pair run_mcts_multithreaded(game::Game *game, decider::Decider *move_ranker); 95 | static std::pair 96 | run_mcts_multithreaded(game::Game *game, int num_threads, decider::Decider *move_ranker); 97 | static std::pair 98 | run_mcts_multithreaded(game::Game *game, int num_threads, decider::Decider *move_ranker, 99 | const std::vector &roots); 100 | 101 | static std::pair run_mcts(game::Game *game, decider::Decider *move_ranker); 102 | 103 | static int SIMULATION_SEARCH_DEPTH; 104 | static int NUM_SIMULATIONS_PER_THREAD; 105 | static int DEFAULT_NUM_THREADS; 106 | 107 | private: 108 | static void mcts(game::Game *game, decider::Decider *move_ranker, Node *root, 109 | std::atomic_int &search_iteration_count, std::atomic_int &thread_finished_count); 110 | 111 | static double expand_node(Node *node, game::Game *game, decider::Decider *move_ranker); 112 | static std::pair select_optimal_move(Node *parent); 113 | static double score_move(Node *parent, Node *child); 114 | static void propagate_result(std::vector &searchPath, double value, piece::PieceColor color); 115 | static void add_dirichlet_noise(Node *node); 116 | }; 117 | 118 | } 119 | 120 | #endif // CHESS_AI_MCTS_NETWORK_TREE_H_ -------------------------------------------------------------------------------- /src/graphics/shader.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "shader.h" 36 | 37 | GLuint graphics::loadShaders(const char *vertex_file_path, const char *fragment_file_path) { 38 | // Create the shaders 39 | GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER); 40 | GLuint FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER); 41 | 42 | // Read the Vertex Shader code from the file 43 | std::string VertexShaderCode; 44 | std::ifstream VertexShaderStream(vertex_file_path, std::ios::in); 45 | if (VertexShaderStream.is_open()) { 46 | std::stringstream sstr; 47 | sstr << VertexShaderStream.rdbuf(); 48 | VertexShaderCode = sstr.str(); 49 | VertexShaderStream.close(); 50 | } else { 51 | std::cerr << "Unable to open " << vertex_file_path << "." << std::endl; 52 | return 0; 53 | } 54 | 55 | // Read the Fragment Shader code from the file 56 | std::string FragmentShaderCode; 57 | std::ifstream FragmentShaderStream(fragment_file_path, std::ios::in); 58 | if (FragmentShaderStream.is_open()) { 59 | std::stringstream sstr; 60 | sstr << FragmentShaderStream.rdbuf(); 61 | FragmentShaderCode = sstr.str(); 62 | FragmentShaderStream.close(); 63 | } else { 64 | std::cerr << "Unable to open " << fragment_file_path << "." << std::endl; 65 | return 0; 66 | } 67 | 68 | GLint Result = GL_FALSE; 69 | int InfoLogLength; 70 | 71 | // Compile Vertex Shader 72 | // printf("Compiling shader: %s\n", vertex_file_path); 73 | char const *VertexSourcePointer = VertexShaderCode.c_str(); 74 | glShaderSource(VertexShaderID, 1, &VertexSourcePointer, nullptr); 75 | glCompileShader(VertexShaderID); 76 | 77 | // Check Vertex Shader 78 | glGetShaderiv(VertexShaderID, GL_COMPILE_STATUS, &Result); 79 | glGetShaderiv(VertexShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength); 80 | if (InfoLogLength > 0) { 81 | std::vector VertexShaderErrorMessage(InfoLogLength + 1); 82 | glGetShaderInfoLog(VertexShaderID, InfoLogLength, nullptr, &VertexShaderErrorMessage[0]); 83 | printf("%s\n", &VertexShaderErrorMessage[0]); 84 | } 85 | 86 | // Compile Fragment Shader 87 | // printf("Compiling shader: %s\n", fragment_file_path); 88 | char const *FragmentSourcePointer = FragmentShaderCode.c_str(); 89 | glShaderSource(FragmentShaderID, 1, &FragmentSourcePointer, nullptr); 90 | glCompileShader(FragmentShaderID); 91 | 92 | // Check Fragment Shader 93 | glGetShaderiv(FragmentShaderID, GL_COMPILE_STATUS, &Result); 94 | glGetShaderiv(FragmentShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength); 95 | if (InfoLogLength > 0) { 96 | std::vector FragmentShaderErrorMessage(InfoLogLength + 1); 97 | glGetShaderInfoLog(FragmentShaderID, InfoLogLength, nullptr, &FragmentShaderErrorMessage[0]); 98 | printf("%s\n", &FragmentShaderErrorMessage[0]); 99 | } 100 | 101 | // Link the program 102 | // printf("Linking program\n"); 103 | GLuint ProgramID = glCreateProgram(); 104 | glAttachShader(ProgramID, VertexShaderID); 105 | glAttachShader(ProgramID, FragmentShaderID); 106 | glLinkProgram(ProgramID); 107 | 108 | // Check the program 109 | glGetProgramiv(ProgramID, GL_LINK_STATUS, &Result); 110 | glGetProgramiv(ProgramID, GL_INFO_LOG_LENGTH, &InfoLogLength); 111 | if (InfoLogLength > 0) { 112 | std::vector ProgramErrorMessage(InfoLogLength + 1); 113 | glGetProgramInfoLog(ProgramID, InfoLogLength, nullptr, &ProgramErrorMessage[0]); 114 | printf("%s\n", &ProgramErrorMessage[0]); 115 | } 116 | 117 | glDetachShader(ProgramID, VertexShaderID); 118 | glDetachShader(ProgramID, FragmentShaderID); 119 | 120 | glDeleteShader(VertexShaderID); 121 | glDeleteShader(FragmentShaderID); 122 | 123 | return ProgramID; 124 | } -------------------------------------------------------------------------------- /src/main/network/make_cases.cpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------------ // 2 | // MIT License // 3 | // // 4 | // Copyright (c) 2020 Utkarsh Priyam // 5 | // // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy // 7 | // of this software and associated documentation files (the "Software"), to deal // 8 | // in the Software without restriction, including without limitation the rights // 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // 10 | // copies of the Software, and to permit persons to whom the Software is // 11 | // furnished to do so, subject to the following conditions: // 12 | // // 13 | // The above copyright notice and this permission notice shall be included in all // 14 | // copies or substantial portions of the Software. // 15 | // // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // 22 | // SOFTWARE. // 23 | // ------------------------------------------------------------------------------ // 24 | 25 | #include "make_cases.h" 26 | 27 | #include 28 | #include 29 | 30 | #include "../run_game.h" 31 | #include "../../util/string_util.h" 32 | #include "../../util/thread_util.h" 33 | 34 | std::atomic_bool network::save_network(false); 35 | 36 | double get_overall_result(double mcts_result, double game_result, double scale = 10.0) { // TODO tweak weights/scale 37 | static double mcts_weight = 4.0; 38 | static double game_result_weight = 1.0; 39 | static double weights_sum = mcts_weight + game_result_weight; // 5.0 40 | 41 | return scale * (mcts_weight * mcts_result + game_result_weight * game_result) / weights_sum; // 4:1 weight 42 | } 43 | 44 | long long file_counter = 0; 45 | void run_simulation_threaded(const int ITERATION_INDEX, std::vector &file_paths, 46 | std::atomic_bool &is_complete) { 47 | game::GameResult result = game::run_game(player::PlayerType::AI, player::PlayerType::AI); 48 | 49 | // Update training case target value 50 | for (auto &pair : network::training_boards) { 51 | pair.second = get_overall_result(pair.second, result.evaluate()); // update case weight 52 | file_paths.push_back(network::save_training_case(std::to_string(file_counter++), pair)); // save case to file 53 | delete pair.first; 54 | } 55 | network::training_boards.clear(); 56 | 57 | if (settings::PRINT_GAME_SIMULATION_DEBUG_INFORMATION) { 58 | // print iteration completion time 59 | std::chrono::system_clock::time_point time_on_start = std::chrono::system_clock::now(); 60 | time_t time = std::chrono::system_clock::to_time_t(time_on_start); 61 | std::cout << "Finished Generating Cases for Game #" << ITERATION_INDEX << ": " << ctime(&time); 62 | } 63 | 64 | is_complete.store(true); 65 | } 66 | void run_simulation(const int ITERATION_INDEX, std::vector &file_paths) { 67 | std::atomic_bool is_complete(false); 68 | run_simulation_threaded(ITERATION_INDEX, file_paths, is_complete); 69 | } 70 | 71 | void network::generate_training_cases(std::vector &file_paths, int &sim_count, int num_simulations) { 72 | generate_training_cases(settings::TRAINING_TERMINATION_CONDITION, file_paths, sim_count, num_simulations); 73 | } 74 | void network::generate_training_cases(const std::function &termination_condition, 75 | std::vector &file_paths, 76 | int &sim_count, int num_simulations) { 77 | network::NetworkStorage::setTestCaseSelector([&](game::Board *b, double d) -> void { 78 | settings::SIMULATION_BOARD_SAVE_PROCEDURE(training_boards, b, d); 79 | }); 80 | 81 | if (!termination_condition()) { 82 | if (settings::PRINT_GAME_SIMULATION_DEBUG_INFORMATION) 83 | std::cout << "GAME SIMULATION TIMESTAMP DATA:" << std::endl; 84 | 85 | if (num_simulations <= 1) { 86 | while (!termination_condition()) 87 | run_simulation(++sim_count, file_paths); 88 | } else { 89 | std::vector sim_checkers(num_simulations); 90 | for (int i = 0; i < num_simulations; ++i) 91 | sim_checkers[i].store(true); 92 | 93 | int cycle_counter = 0; 94 | thread::do_while_waiting_for([&] { 95 | for (auto &it: sim_checkers) 96 | if (it) { 97 | it.store(false); 98 | thread::create(run_simulation_threaded, ++sim_count, std::ref(file_paths), std::ref(it)); 99 | ++cycle_counter; 100 | } 101 | if (cycle_counter >= num_simulations) { 102 | cycle_counter -= num_simulations; 103 | save_network.store(true); // TODO sync better with save in train.cpp @ ~line 36 104 | } 105 | }, termination_condition); 106 | thread::wait_for([&] { 107 | return !std::any_of(sim_checkers.begin(), sim_checkers.end(), [](std::atomic_bool &b) { return !b.load(); }); 108 | }); 109 | } 110 | } 111 | } 112 | 113 | std::string 114 | network::save_training_case(const std::string &case_index, const std::pair &training_case) { 115 | std::string file_path = "training_cases/case_" + case_index + ".txt"; 116 | training_case.first->saveToFile( 117 | file_path, 118 | [&](std::ostream &out) -> void { out << string::from_double(training_case.second) << std::endl; }, 119 | false 120 | ); 121 | return file_path; 122 | } 123 | std::pair network::load_training_case(const std::string &file_path, bool pad_file_path) { 124 | double weight; 125 | auto *b = new game::Board(8, 8); 126 | b->loadFromFile(pad_file_path ? "training_cases/" + file_path + ".txt": file_path, 127 | [&](std::istream &in) -> void { in >> weight; }); 128 | return {b, weight}; 129 | } --------------------------------------------------------------------------------