diff --git a/LICENSE b/LICENSE
old mode 100644
new mode 100755
index ed62595..c0a31ff
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,21 @@
-MIT License
-
-Copyright (c) 2023 rodpolako
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+MIT License
+
+Copyright (c) 2023 rodpolako
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index ae0ae79..c06f76f
--- a/README.md
+++ b/README.md
@@ -1,69 +1,69 @@
-# Chess PGN Trainer
-Online tool that opens chess PGN files and allows the user to practice the moves. This tool is to help with drilling, ***as efficiently as possible***, a set group of puzzles/games in an appropriately configured PGN file. Once the set is complete, the player sees how many errors they made as well as how long the set took to complete.
-
-The original design goal was to help with implementing a learning approach where a player repeatedly completes the same series of puzzles, striving to reduce both errors and time needed with each round.
-The idea for this came from a recommendation by Dan Heisman (https://www.danheisman.com/recommended-books.html) on how to practice tactics puzzles. In the article, Dan strongly recommends the idea of "repeatedly going through the book faster and faster until you can get 85%+ within 10-15 seconds". You can read about my own results following this approach using this tool [here](https://www.chess.com/forum/view/for-beginners/applying-dan-heismans-guide-to-using-chess-tactics-for-students).
-
-Since then, the tool has grown and can now be used to:
-* Practice puzzles
-* Practice openings for black or white
-* Practice entire games (useful for learning full games or for playing solitaire chess such as "Guess the Move")
-
-See the sample PGN files in the /examples folder for more information. The samples include puzzles, openings for both white and black, as well as some famous games to practice.
-
-Also included is a PGN of a slighly modified [Aman Hambleton's reset mate](https://www.youtube.com/watch?v=XAlcDWQ6iTM) for those who want to practice that sequence along with the same sequence mirrored for black pieces. The PGN also highlights some of the annotation features available including embedding a YouTube video as well as comments during the move sequence.
-
-[A live online copy of tool is available here](https://rodpolako.github.io/)
-
-
-## Features
-This tool has a number of features that you might find useful:
-* Auto move to next puzzle - Automatically advances to the next puzzle/game upon completion of the current one. This can be disabled via the use of the "Next button" option.
-* Play both sides - Allows the player to play both sides of the puzzle/game
-* Randomize - Presents the puzzles/games in the set in a random order
-* Flipped - Allows you to play the puzzle/game from the other side of the board. May help to develop sense when a given tactic is being used on you.
-* Play Opposite Side - Allows the player to go second instead and makes the computer play the first move from the PGN. Useful for when you want to practice opening defenses instead of puzzles. For example, if you wanted to practice a defense as black, load a PGN with the move order you want to practice and this feature will play as white and play the moves in the PGN while you play the response. Recommended that you use the Flipped option in conjunction with this one.
-* Analysis board - More useful for puzzles, this option generates a link to a Lichess analysis board of the currently displayed puzzle as per the PGN. Useful when you want to analyze a specific puzzle during a run in order to analyze or troubleshoot. This will place a link below the title of the puzzle which if clicked will open an analysis board in Lichess with the position in a new tab.
-* Pause - Useful if you are doing a large number of puzzles/games and need to step away. Click on the pause button and the board will clear and the timer will stop. Click Resume in order to continue. Your elapsed time will not include the paused time.
-* Hints - You can press the hint button at any time during a puzzle/game to see the next expected move. Just know that if a hint is used, it will be counted as an error in your performance.
-* Restart/replay - You can repeat the current puzzle/game set upon completion with a single click. Useful if you want to try again with the same settings. When the current set is complete, just click on "Restart" to try the current PGN file again. If you want, you can choose different settings like random, flipped, etc. before restarting.
-* Feature settings via PGN Tags - You can configure a PGN to set a default combination of features by adding the relevant tag to the top of the PGN. Details below.
-* Responsive design allows the app to be used in either portrait or landscape mode which means that it is able to be used on phones and tablets along with desktop.
-* Choice of multiple piece designs - Note this will reset the board so don't change sets while in the middle of puzzle set.
-* Ability to specify custom board colors either by manual entry or color picking
-* Dark mode
-* Ability to copy results to clipboard ready to paste into a spreadsheet.
-* Ability to export results to CSV file along with setting to include the headers
-* Ability to add additional piece sets (either PNG for SVG) for hosted instances only. Not available on github.io page.
-* Support for annotations - Comments in PGN files will display in the annotation panel to the left of the board. Annotations can use HTML tags so the PGN comments can be fully featured with things like headings, bullets, bold, italics, links, thumbnails, video, etc. If present, annotations will display while completing the puzzle. Board-level annotations, like circles and arrows is not yet available, but planned.
-**Note:** The annotation panel will only be available on screens wider than 992 pixels (1024 or higher recommended).
-
-## Setup Instructions
-If you just want to use the trainer and and not bother hosting the page yourself, you can just use the live link [here](https://rodpolako.github.io/). The latest version of the trainer will always be hosted there.
-
-If you want to host a copy on your own environment and/or make changes:
-1. Download & extract the zip into a folder and start a web server from there.
-2. In a browser, point to ```index.html```. On my own setup, the URL is ```localhost:8000/index.html``` but may be different for your setup. Refer to your web server for details.
-
-## Usage
-1. Click on "Open PGN File"
-2. Navigate to the desired PGN file and then click on OK
-3. Activate any desired features (such as random, flipped, play both sides)
-4. When ready, click on start and the first puzzle in the set will be displayed and you can make your first move.
-5. When the puzzle/game is finished, the next puzzle/game in the set will be automatically loaded. This is the default action unless you select the "next button" option. If you used the "next button" option, click on the next button to proceed to the next puzzle.
-6. When the set of puzzles/games is complete, your final stats will be displayed.
-7. You can pause any time if you need to step away.
-8. If you get stuck you can get a hint by clicking the hint button.
-
-You can then start a new PGN file by repeating these steps.
-
-Once a test group is completed, tool displays the following performance information:
-* Number of errors
-* Time to completion
-* Average time per puzzle/game (Calculated)
-* Error rate (Calculated)
-
-
-
-## Documentation
-See the [Wiki](https://github.com/rodpolako/Chess-PGN-Trainer/wiki) for a complete documentation.
+# Chess PGN Trainer
+Online tool that opens chess PGN files and allows the user to practice the moves. This tool is to help with drilling, ***as efficiently as possible***, a set group of puzzles/games in an appropriately configured PGN file. Once the set is complete, the player sees how many errors they made as well as how long the set took to complete.
+
+The original design goal was to help with implementing a learning approach where a player repeatedly completes the same series of puzzles, striving to reduce both errors and time needed with each round.
+The idea for this came from a recommendation by Dan Heisman (https://www.danheisman.com/recommended-books.html) on how to practice tactics puzzles. In the article, Dan strongly recommends the idea of "repeatedly going through the book faster and faster until you can get 85%+ within 10-15 seconds". You can read about my own results following this approach using this tool [here](https://www.chess.com/forum/view/for-beginners/applying-dan-heismans-guide-to-using-chess-tactics-for-students).
+
+Since then, the tool has grown and can now be used to:
+* Practice puzzles
+* Practice openings for black or white
+* Practice entire games (useful for learning full games or for playing solitaire chess such as "Guess the Move")
+
+See the sample PGN files in the /examples folder for more information. The samples include puzzles, openings for both white and black, as well as some famous games to practice.
+
+Also included is a PGN of a slighly modified [Aman Hambleton's reset mate](https://www.youtube.com/watch?v=XAlcDWQ6iTM) for those who want to practice that sequence along with the same sequence mirrored for black pieces. The PGN also highlights some of the annotation features available including embedding a YouTube video as well as comments during the move sequence.
+
+[A live online copy of tool is available here](https://rodpolako.github.io/)
+
+
+## Features
+This tool has a number of features that you might find useful:
+* Auto move to next puzzle - Automatically advances to the next puzzle/game upon completion of the current one. This can be disabled via the use of the "Next button" option.
+* Play both sides - Allows the player to play both sides of the puzzle/game
+* Randomize - Presents the puzzles/games in the set in a random order
+* Flipped - Allows you to play the puzzle/game from the other side of the board. May help to develop sense when a given tactic is being used on you.
+* Play Opposite Side - Allows the player to go second instead and makes the computer play the first move from the PGN. Useful for when you want to practice opening defenses instead of puzzles. For example, if you wanted to practice a defense as black, load a PGN with the move order you want to practice and this feature will play as white and play the moves in the PGN while you play the response. Recommended that you use the Flipped option in conjunction with this one.
+* Analysis board - More useful for puzzles, this option generates a link to a Lichess analysis board of the currently displayed puzzle as per the PGN. Useful when you want to analyze a specific puzzle during a run in order to analyze or troubleshoot. This will place a link below the title of the puzzle which if clicked will open an analysis board in Lichess with the position in a new tab.
+* Pause - Useful if you are doing a large number of puzzles/games and need to step away. Click on the pause button and the board will clear and the timer will stop. Click Resume in order to continue. Your elapsed time will not include the paused time.
+* Hints - You can press the hint button at any time during a puzzle/game to see the next expected move. Just know that if a hint is used, it will be counted as an error in your performance.
+* Restart/replay - You can repeat the current puzzle/game set upon completion with a single click. Useful if you want to try again with the same settings. When the current set is complete, just click on "Restart" to try the current PGN file again. If you want, you can choose different settings like random, flipped, etc. before restarting.
+* Feature settings via PGN Tags - You can configure a PGN to set a default combination of features by adding the relevant tag to the top of the PGN. Details below.
+* Responsive design allows the app to be used in either portrait or landscape mode which means that it is able to be used on phones and tablets along with desktop.
+* Choice of multiple piece designs - Note this will reset the board so don't change sets while in the middle of puzzle set.
+* Ability to specify custom board colors either by manual entry or color picking
+* Dark mode
+* Ability to copy results to clipboard ready to paste into a spreadsheet.
+* Ability to export results to CSV file along with setting to include the headers
+* Ability to add additional piece sets (either PNG for SVG) for hosted instances only. Not available on github.io page.
+* Support for annotations - Comments in PGN files will display in the annotation panel to the left of the board. Annotations can use HTML tags so the PGN comments can be fully featured with things like headings, bullets, bold, italics, links, thumbnails, video, etc. If present, annotations will display while completing the puzzle. Board-level annotations, like circles and arrows is not yet available, but planned.
+**Note:** The annotation panel will only be available on screens wider than 992 pixels (1024 or higher recommended).
+
+## Setup Instructions
+If you just want to use the trainer and and not bother hosting the page yourself, you can just use the live link [here](https://rodpolako.github.io/). The latest version of the trainer will always be hosted there.
+
+If you want to host a copy on your own environment and/or make changes:
+1. Download & extract the zip into a folder and start a web server from there.
+2. In a browser, point to ```index.html```. On my own setup, the URL is ```localhost:8000/index.html``` but may be different for your setup. Refer to your web server for details.
+
+## Usage
+1. Click on "Open PGN File"
+2. Navigate to the desired PGN file and then click on OK
+3. Activate any desired features (such as random, flipped, play both sides)
+4. When ready, click on start and the first puzzle in the set will be displayed and you can make your first move.
+5. When the puzzle/game is finished, the next puzzle/game in the set will be automatically loaded. This is the default action unless you select the "next button" option. If you used the "next button" option, click on the next button to proceed to the next puzzle.
+6. When the set of puzzles/games is complete, your final stats will be displayed.
+7. You can pause any time if you need to step away.
+8. If you get stuck you can get a hint by clicking the hint button.
+
+You can then start a new PGN file by repeating these steps.
+
+Once a test group is completed, tool displays the following performance information:
+* Number of errors
+* Time to completion
+* Average time per puzzle/game (Calculated)
+* Error rate (Calculated)
+
+
+
+## Documentation
+See the [Wiki](https://github.com/rodpolako/Chess-PGN-Trainer/wiki) for a complete documentation.
diff --git a/Release Notes.md b/Release Notes.md
old mode 100644
new mode 100755
index c2f2af5..6131e9c
--- a/Release Notes.md
+++ b/Release Notes.md
@@ -1,9 +1,5 @@
# Changes in this version:
-* Added ability for the app to show dots for legal moves (can be managed via settings)
-* Incorrect moves will now briefly flash the incorrect square red
-* Added ability to set the movement speed of the pieces.
-* Upgraded the legacy pawn promotion code to bootstrap and removed dependence on jQuery-UI. This cut down code size by nearly 25%.
-* Added the ability for Circles & Arrows in the PGN annotation to be shown on the board. The example PGNs have been updated again to showcase this feature.
-* Code cleanup and bug fixes
-*
+* Updated the analysis link option to always send current position instead of puzzle beginning.
+* Updated the handling of null moves
+* Fixed a bug where moving a piece from a square that had a circle would require a double-click to drop in new location
diff --git a/assets/annotate.js b/assets/annotate.js
index e962a25..749cc21 100644
--- a/assets/annotate.js
+++ b/assets/annotate.js
@@ -2,7 +2,7 @@
// Annotation functions
// ---------------------
-/* global $, game, document, currentPuzzle */
+/* global $, game, document, currentPuzzle, moveHistory */
/* exported drawDot, clearAllDots, markError, annotate */
// Annotation Color-related data
@@ -27,11 +27,17 @@ function drawDot(square) {
$(".square-" + square).append('
');
}
+/**
+ * Draw a dot in the center of the square (used for showing legal moves)
+ */
function clearAllDots() {
// Delete the legal move dots
$(".dot").remove();
}
+/**
+ * Flash a sqaure red
+ */
function markError(square) {
if (!validateSquare(square)) {
return;
@@ -47,8 +53,14 @@ function markError(square) {
$(".error").fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100);
}
-function annotateShapes() {
- let gameMoveIndex = game.history().length - 1; // Last move played
+/**
+ * Draw any recorded shape data for this move (circles or arrows)
+ *
+ * @param {int} offset - Value to increase the move index (so you can draw shapes from moves ahead of the game if present)
+ */
+function annotateShapes(offset) {
+ offset = offset || 0;
+ let gameMoveIndex = game.history().length - 1 + offset; // Last move played
try {
drawAnnotationCircle(currentPuzzle.moves[gameMoveIndex].commentDiag.colorFields);
@@ -79,6 +91,12 @@ function annotateShapes() {
}
}
+/**
+ * Validate input square
+ *
+ * @param {*} square - The square needing validation
+ * @returns true if square is valid, false if not
+ */
function validateSquare(square) {
// Input must be 2 characters
if (square.length !== 2) {
@@ -100,6 +118,12 @@ function validateSquare(square) {
return true;
}
+/**
+ * Validate drawing annotation
+ *
+ * @param {*} inputtext - The drawing instruction from the PGN
+ * @returns true if drawing annotation is valid, false if not
+ */
function validateInput(inputtext) {
// Input has to be either 3 or 5 characters long
if (inputtext.length !== 3 && inputtext.length !== 5) {
@@ -124,6 +148,12 @@ function validateInput(inputtext) {
return true;
}
+/**
+ * Prepare drawing instructions
+ *
+ * @param {*} inputtext - Drawing instruction
+ * @returns object with details necessary to draw circles and arrows according to the drawing instruction
+ */
function generateDrawingData(inputtext) {
// First validate that the input is good:
if (!validateInput(inputtext)) {
@@ -144,10 +174,14 @@ function generateDrawingData(inputtext) {
squareObject.destinationxy = getSquareCenterCoordinates(squareObject.destination);
}
- //console.log(squareObject);
return squareObject;
}
+/**
+ *
+ * @param {array} circleArray - Array of square and color data needing circles drawn
+ * @returns
+ */
function drawAnnotationCircle(circleArray) {
if (!circleArray) {
return;
@@ -171,11 +205,14 @@ function drawAnnotationCircle(circleArray) {
let target = $(squarePath + annotationdata.origin);
// Draw the circle on top of anything else on that square
- let circleDetails = '';
+ let circleDetails = '';
$(target).append(circleDetails);
});
}
+/**
+ * Deletes any currently visible circles or arrows
+ */
function deleteAllShapeAnnotations() {
// Delete the circles
$(".circleannotation").remove();
@@ -208,9 +245,12 @@ function stripNewLine(sourcetext) {
* @param {string} annotationText - The content to be added to the annotation panel
*/
function addAnnotationComment(annotationText) {
- $("#comment_annotation").append("
");
+ }
+
}
/**
@@ -271,6 +311,36 @@ function translateNAG(NAGValue) {
return tag;
}
+/**
+ * Add annotations for null moves (if present)
+ *
+ * @param {int} moveindex - The move index of the game to test for null moves
+ */
+function checkForNullMove(moveindex) {
+
+ // Have we reached end of game? Game cannot proceed beyond a null move.
+ if (game.history().length === moveHistory.length){
+
+ // Check to see if the parser has more moves than the game.
+ // If it does, this means that the parser found a null move and has recorded it AFTER the last move of the game.
+ if(currentPuzzle.moves.length > game.history().length){
+
+ // Add any annotations if present
+ try {
+ addAnnotationComment(currentPuzzle.moves[moveindex + 1].commentAfter);
+ } catch (e) {
+ // Object doesn't exist, therefore don't do anything
+ }
+
+ // If the null move has any shape data as well, draw it.
+ annotateShapes(1);
+ }
+
+ }
+
+}
+
+
/**
* Read details of the current move along with any avaialble annotations and display them
*/
@@ -321,6 +391,9 @@ function annotate() {
addAnnotationComment(currentPuzzle.moves[gameMoveIndex].commentAfter);
}
+ // Check for null move
+ checkForNullMove(gameMoveIndex)
+
// Draw any shapes if present.
annotateShapes();
@@ -348,18 +421,29 @@ function annotate() {
addAnnotationComment(currentPuzzle.moves[gameMoveIndex].commentAfter);
}
+ // Check for null move
+ checkForNullMove(gameMoveIndex)
+
// Add scroll here to automatically show the bottom of the column
document.getElementById("comment_annotation").scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
// Draw any shapes that accompany this position
annotateShapes();
+
}
+/**
+ * Get the XY coordinates indicating the center of a target square.
+ *
+ * @param {string} square - The square requiring coordinate data
+ * @returns coordinate data
+ */
function getSquareCenterCoordinates(square) {
- // Define the target square
+ // Define the target square
let target = $(squarePath + square);
+ // Find the center coordinates for the square relative to its container
var centerX = target[0].offsetLeft + target[0].clientWidth / 2 - target[0].parentElement.parentElement.offsetLeft;
var centerY = target[0].offsetTop + target[0].clientHeight / 2 - target[0].parentElement.parentElement.offsetTop;
@@ -371,7 +455,20 @@ function getSquareCenterCoordinates(square) {
return coordinates;
}
-// Credit for this neat function belongs to https://stackoverflow.com/questions/808826/drawing-an-arrow-using-html-canvas
+/**
+ * Arrow drawing function
+ *
+ * @param {*} ctx - Canvas context
+ * @param {*} fromx - X coordinate of starting point
+ * @param {*} fromy - Y coordinate of starting point
+ * @param {*} tox - X coordinate of ending point
+ * @param {*} toy - Y coordinate of ending point
+ * @param {*} arrowWidth - thickness of arrow
+ * @param {*} color - color of arrow
+ * @param {*} alpha - opacity of arrow
+ *
+ * Credit for this neat function belongs to https://stackoverflow.com/questions/808826/drawing-an-arrow-using-html-canvas
+ */
function drawArrow(ctx, fromx, fromy, tox, toy, arrowWidth, color, alpha) {
//variables to be used when creating the arrow
var headlen = 10;
@@ -410,6 +507,13 @@ function drawArrow(ctx, fromx, fromy, tox, toy, arrowWidth, color, alpha) {
ctx.restore();
}
+
+/**
+ * Draws all arrows as instructed
+ *
+ * @param {array} ArrowArray - Arraay of drawing instructions
+ * @returns
+ */
function drawAnnotationArrow(ArrowArray) {
// Exit immediately if there are issues with the input
if (!ArrowArray) {
@@ -446,6 +550,10 @@ function drawAnnotationArrow(ArrowArray) {
});
}
+
+/**
+ * Create a 2d drawing surface for the arrows
+ */
function createCanvas() {
// Credit for this function goes to https://stackoverflow.com/questions/10214873/make-canvas-as-wide-and-as-high-as-parent
function fitToContainer(canvas) {
diff --git a/assets/chess-pgn-trainer.css b/assets/chess-pgn-trainer.css
old mode 100644
new mode 100755
diff --git a/assets/chess-pgn-trainer.js b/assets/chess-pgn-trainer.js
old mode 100644
new mode 100755
index c09ffa1..d3303a8
--- a/assets/chess-pgn-trainer.js
+++ b/assets/chess-pgn-trainer.js
@@ -18,15 +18,11 @@
/* exported loadPGNFile, outputStats2CSV, currentPuzzle, promotionSquare, */
/*
-TODO:
COMPLETE:
-* Added the ability for Circles & Arrows in the PGN annotation to be shown on the board.
-* Added ability for the app to show dots for legal moves (can be managed via settings)
-* Incorrect moves will now briefly flash the incorrect square red
-* Update the legacy pawn promotion code to bootstrap and drop Jquery-UI
-* Code cleanup
-* Added ability to set the movement speed of the pieces.
+* Update analysis link to always send current position instead of puzzle beginning.
+* Update the handling of null moves
+* Fixed a bug where moving a piece from a square that had a circle would require a double-click to drop in new location
*/
@@ -35,7 +31,7 @@ COMPLETE:
// -----------------------
// Board & Overall configuration-related variables
-const version = "1.11.0";
+const version = "1.11.1";
let board;
let blankBoard;
let pieceThemePath;
@@ -337,6 +333,10 @@ function loadSettings() {
$("#speedRange").val(readItem("speed"));
}
+
+/**
+ * Adjust the saved speed value based on the slider setting
+ */
function adjustspeedslider() {
saveItem("speed", $("#speedRange").val());
@@ -473,18 +473,19 @@ function checkAndPlayNext(target) {
if (game.history()[gameMoveIndex] === moveHistory[gameMoveIndex]) {
// correct move
-
- // Output any comment after this move
- annotate();
+
+ // Post-move functions
+ moveMade();
// play next move if the "Play both sides" box is unchecked and there are still moves to play
if (!$("#playbothsides").is(":checked")) {
if (game.history().length !== moveHistory.length) {
+
// Play the opponent's next move from the PGN
game.move(moveHistory[game.history().length]);
- // Output any comment after this move
- annotate();
+ // Post-move functions
+ moveMade();
}
}
} else {
@@ -621,6 +622,10 @@ function pauseGame() {
changecolor();
}
+
+/**
+ * Set the configuration for the board prior to creating/re-creating the board(s)
+ */
function setBoardConfig() {
if (readItem("speed") == null || readItem("speed") == "") {
saveItem("speed", 200);
@@ -844,6 +849,43 @@ function updateProgressBar(partial_value, total_value) {
$("#progressbar").text(progresspercent);
}
+
+/**
+ * Create a link of the current position to lichess analysis board
+ */
+function updateAnalysisLink() {
+
+ if (game.fen()) {
+ var lichessURL = '';
+ }
+
+ if (AnalysisLink && lichessURL) {
+ // Add the link under the puzzle name in mobile mode
+ $("#puzzlename").append(" ");
+ $("#puzzlename").append(lichessURL);
+ $("a#analysisURL").text("Analysis board");
+
+ // Add the link under the event name in the annotation panel
+ $("#analysisDiv").empty();
+ $("#analysisDiv").append(lichessURL);
+ $("a#analysisURL").text("Analysis board");
+ $("#comment_event_name_analysis_link").show();
+ }
+
+}
+
+/**
+ * Common functions required after making a move
+ */
+function moveMade() {
+
+ // Output any comment after this move
+ annotate();
+
+ // Update the analysis link (if enabled)
+ updateAnalysisLink();
+}
+
/**
* Load the desired puzzle or position from the PGN to the screen
*
@@ -871,23 +913,6 @@ function loadPuzzle(PGNPuzzle) {
AnalysisLink = true;
}
- if (PGNPuzzle.tags.FEN) {
- var lichessURL = '';
- }
-
- if (AnalysisLink && lichessURL) {
- // Add the link under the puzzle name in mobile mode
- $("#puzzlename").append(" ");
- $("#puzzlename").append(lichessURL);
- $("a#analysisURL").text("Analysis board");
-
- // Add the link under the event name in the annotation panel
- $("#analysisDiv").empty();
- $("#analysisDiv").append(lichessURL);
- $("a#analysisURL").text("Analysis board");
- $("#comment_event_name_analysis_link").show();
- }
-
currentPuzzle = PGNPuzzle; // Use this in order to access the PGN from anywhere
// Display current puzzle number in the sequence
@@ -938,6 +963,8 @@ function loadPuzzle(PGNPuzzle) {
// Set the board to the beginning position of the puzzle
updateBoard(false);
+ $("#comment_annotation").append(" ");
+
// If there is commentary before the first move, show it in the annotation panel
if (PGNPuzzle.gameComment != null) {
$("#comment_annotation").prop("innerHTML", stripNewLine(PGNPuzzle.gameComment.comment));
@@ -948,18 +975,21 @@ function loadPuzzle(PGNPuzzle) {
// Draw any shapes if present
annotateShapes();
+
}
+
// Check to see if the computer needs to play the first move due to the conflict between the FEN and the MoveColor tag (unless player is playing both sides)
if (PGNPuzzle.tags.MoveColor != game.turn() && typeof PGNPuzzle.tags.MoveColor !== "undefined" && !$("#playbothsides").is(":checked")) {
+
// There is a discrepency, make the first move
game.move(moveHistory[moveindex]);
-
+
// Set the board to the next position of the puzzle
updateBoard(true);
- // Output any comment after this move
- annotate();
+ // Post-move functions
+ moveMade();
// Update the index so that if play opposite side is used it plays the NEXT move
moveindex = 1;
@@ -972,20 +1002,25 @@ function loadPuzzle(PGNPuzzle) {
// Play the first move if player is playing second and not both sides
if ($("#playoppositeside").is(":checked") && !$("#playbothsides").is(":checked")) {
+
// Make the move
game.move(moveHistory[moveindex]);
-
+
// Set the board to the next position of the puzzle
updateBoard(true);
- // Output any comment after this move
- annotate();
+ // Post-move functions
+ moveMade();
}
// Update the status of the game in memory with the new data
indicateMove();
changecolor();
+
+ // Put up the analysis link (if enabled)
+ updateAnalysisLink();
+
}
/**
@@ -1118,6 +1153,10 @@ function dropPiece(source, target) {
*/
function snapEnd() {
// Update instantly if the puzzle is done
+ if (puzzlecomplete) {
+ updateBoard(false);
+ return;
+ }
updateBoard(true);
}
diff --git a/assets/chessboard-1.0.0.css b/assets/chessboard-1.0.0.css
old mode 100644
new mode 100755
index 507b6f1..252ef78
--- a/assets/chessboard-1.0.0.css
+++ b/assets/chessboard-1.0.0.css
@@ -1,54 +1,54 @@
-/*! chessboard.js v1.0.0 | (c) 2019 Chris Oakman | MIT License chessboardjs.com/license */
-
-.clearfix-7da63 {
- clear: both;
-}
-
-.board-b72b1 {
- border: 2px solid #404040;
- box-sizing: content-box;
-}
-
-.square-55d63 {
- float: left;
- position: relative;
-
- /* disable any native browser highlighting */
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.white-1e1d7 {
- background-color: #f0d9b5;
- color: #b58863;
-}
-
-.black-3c85d {
- background-color: #b58863;
- color: #f0d9b5;
-}
-
-.highlight1-32417, .highlight2-9c5d2 {
- box-shadow: inset 0 0 3px 3px yellow;
-}
-
-.notation-322f9 {
- cursor: default;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- position: absolute;
-}
-
-.alpha-d2270 {
- bottom: 1px;
- right: 3px;
-}
-
-.numeric-fc462 {
- top: 2px;
- left: 2px;
-}
+/*! chessboard.js v1.0.0 | (c) 2019 Chris Oakman | MIT License chessboardjs.com/license */
+
+.clearfix-7da63 {
+ clear: both;
+}
+
+.board-b72b1 {
+ border: 2px solid #404040;
+ box-sizing: content-box;
+}
+
+.square-55d63 {
+ float: left;
+ position: relative;
+
+ /* disable any native browser highlighting */
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.white-1e1d7 {
+ background-color: #f0d9b5;
+ color: #b58863;
+}
+
+.black-3c85d {
+ background-color: #b58863;
+ color: #f0d9b5;
+}
+
+.highlight1-32417, .highlight2-9c5d2 {
+ box-shadow: inset 0 0 3px 3px yellow;
+}
+
+.notation-322f9 {
+ cursor: default;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ position: absolute;
+}
+
+.alpha-d2270 {
+ bottom: 1px;
+ right: 3px;
+}
+
+.numeric-fc462 {
+ top: 2px;
+ left: 2px;
+}
diff --git a/assets/chessboard-1.0.0.js b/assets/chessboard-1.0.0.js
old mode 100644
new mode 100755
diff --git a/assets/jquery.minicolors.css b/assets/jquery.minicolors.css
old mode 100644
new mode 100755
diff --git a/assets/jquery.minicolors.js b/assets/jquery.minicolors.js
old mode 100644
new mode 100755
diff --git a/assets/jquery.minicolors.png b/assets/jquery.minicolors.png
old mode 100644
new mode 100755
diff --git a/assets/pgn-handling.js b/assets/pgn-handling.js
index bd16c07..a7ca2c9 100644
--- a/assets/pgn-handling.js
+++ b/assets/pgn-handling.js
@@ -14,6 +14,7 @@
function splitvariants(PGNData) {
let PGNobjectArray = [];
+ // Recursive function to follow a variation path
function createPGNVariant(myObject, pathlist) {
let tempObj = [];
Object.assign(tempObj, pathlist);
@@ -72,11 +73,27 @@ function loadPGNFile() {
PGNFile = PGNFile.trim(); // Remove extra blank lines before and after the content
// Remove double-hyphen notation if present (causes exception otherwise)
- // Opened issue @ https://github.com/mliebelt/pgn-parser/issues/641
- PGNFile = PGNFile.replace(/ (\d*)[.] --/g, ""); // White
- PGNFile = PGNFile.replaceAll("-- ", ""); // Black
+ // Original fix (just remove the -- altogether)
+ // PGNFile = PGNFile.replace(/ (\d*)[.] --/g, ""); // White
+ // PGNFile = PGNFile.replaceAll("-- ", ""); // Black
+ // Opened issue @ https://github.com/mliebelt/pgn-parser/issues/641
+ // Potential fix due to https://github.com/mliebelt/pgn-parser/issues/436
+ // Replace other null identifiers with Z0 notation which is already supported by the parser as a null move.
+
+ // See: https://chess.stackexchange.com/questions/14072/san-for-nullmove for list of possible null move indicators
+
+ PGNFile = PGNFile
+ .replaceAll("0000", "Z0")
+ .replaceAll("00-00", "Z0")
+ .replaceAll("--", "Z0")
+ .replaceAll("@@@@", "Z0")
+ .replaceAll("<>", "Z0")
+ .replaceAll("pass", "Z0")
+ .replaceAll("(null)", "Z0")
+ .replaceAll("null", "Z0");
+
try {
parsePGN(PGNFile);
diff --git a/assets/pgn-parser-min.js b/assets/pgn-parser-min.js
old mode 100644
new mode 100755
diff --git a/assets/piece-list.js b/assets/piece-list.js
old mode 100644
new mode 100755
index 4284838..81919d0
--- a/assets/piece-list.js
+++ b/assets/piece-list.js
@@ -1,39 +1,39 @@
-/**
- * Piece theme list
- *
- * This file creates the PieceList object which is used by the application to give the option of piece sets
- *
- * There are three values needed:
- * Name - The name to display in the Piece Select drop down
- * DirectoryName - The name of the directory which contains the pieces
- * Type - The extension of the piece images (typically SVG or PNG)
- *
- * A piece folder contains 12 files (6 for white and 6 for black) that start with either b or w (black or white lowercase)
- * and then one of the following uppercase letters to indicate the piece:
- * K - King
- * Q - Queen
- * B - Bishop
- * N - Knight
- * R - Rook
- * P - Pawn
- *
- * As an example, bK would indicate black king while wP would indicate white pawn. See any of the current piece sets for examples.
- *
- *
- * To add a piece set to the application:
- * 1. Create a folder containing the pieces inside /img/chesspieces
- * 2. Update the object below to add an entry for the new set
- * 3. Refresh the page and the new set will be listed in the drop down
- *
- */
-
-/* exported PieceList */
-
-let PieceList = [
- { Name: "Alpha", DirectoryName: "alpha", Type: "svg" },
- { Name: "Cburnett", DirectoryName: "cburnett", Type: "svg" },
- { Name: "Chessnut", DirectoryName: "chessnut", Type: "svg" },
- { Name: "Merida", DirectoryName: "merida", Type: "svg" },
- { Name: "Staunty", DirectoryName: "staunty", Type: "svg" },
- { Name: "Tatiana", DirectoryName: "tatiana", Type: "svg" },
-];
+/**
+ * Piece theme list
+ *
+ * This file creates the PieceList object which is used by the application to give the option of piece sets
+ *
+ * There are three values needed:
+ * Name - The name to display in the Piece Select drop down
+ * DirectoryName - The name of the directory which contains the pieces
+ * Type - The extension of the piece images (typically SVG or PNG)
+ *
+ * A piece folder contains 12 files (6 for white and 6 for black) that start with either b or w (black or white lowercase)
+ * and then one of the following uppercase letters to indicate the piece:
+ * K - King
+ * Q - Queen
+ * B - Bishop
+ * N - Knight
+ * R - Rook
+ * P - Pawn
+ *
+ * As an example, bK would indicate black king while wP would indicate white pawn. See any of the current piece sets for examples.
+ *
+ *
+ * To add a piece set to the application:
+ * 1. Create a folder containing the pieces inside /img/chesspieces
+ * 2. Update the object below to add an entry for the new set
+ * 3. Refresh the page and the new set will be listed in the drop down
+ *
+ */
+
+/* exported PieceList */
+
+let PieceList = [
+ { Name: "Alpha", DirectoryName: "alpha", Type: "svg" },
+ { Name: "Cburnett", DirectoryName: "cburnett", Type: "svg" },
+ { Name: "Chessnut", DirectoryName: "chessnut", Type: "svg" },
+ { Name: "Merida", DirectoryName: "merida", Type: "svg" },
+ { Name: "Staunty", DirectoryName: "staunty", Type: "svg" },
+ { Name: "Tatiana", DirectoryName: "tatiana", Type: "svg" },
+];
diff --git a/examples/Black Defense Example.pgn b/examples/Black Defense Example.pgn
old mode 100644
new mode 100755
index a4356ea..1dff422
--- a/examples/Black Defense Example.pgn
+++ b/examples/Black Defense Example.pgn
@@ -1,15 +1,15 @@
-[PGNTrainerOppositeSide "1"]
-[PGNTrainerRandomize "1"]
-[PGNTrainerFlipped "1"]
-[Event "Caro-Kann Defense"]
-[Result "*"]
-
-{ The Caro-Kann is considered solid and safe with a better pawn structure (often leading to good endgames). However, White has many possible responses and may develop faster than Black. Out of the Semi-Open games, the opening is thought to be less dynamic than the Sicilian and the French.
-
-In the traditional Open Game (1. e4 e5), many of the big threats that Black may face target the weak f7-square with White's bishop positioned on c4. And, Black often can consider this threat resolved if Black succeeds in pushing their queen pawn to d5. Thus, the idea of the Caro-Kann (as well as the French Defence) is to support a pushed queen pawn on d5 at the early stage in the opening. The Caro-Kann achieves this with 1...c6 (while the French does so via 1...e6).
-
-In choosing the Caro-Kann, Black gives up the centre in exchange for easier development. Black often aims to let White's pawns overextend, or develop a poor structure, and take advantage in the endgame. }
-1. e4 { [%cal Gc7c6] } 1... c6 2. d4 { [%cal Gd7d5] } 2... d5 { [%csl Rd5][%cal Ge4e5,Re4d5] } 3. e5 { [%cal Gc6c5] } (3. exd5 { White exchanges on d5, and black almost always responds with cxd5. This forms opposite-wing majorities.
-This usually will lead into a Panov-Botvinnik Attack, although independent lines can arise after 4.Bd3. } { [%cal Gc6d5] } 3... cxd5 4. Bd3 { [%cal Gb8c6] } 4... Nc6) 3... c5 { [%csl Rd4] } 4. c3 Nc6 { White’s most popular response to the Botvinnik-Carls Defense according to the Lichess database, accounting for more than half of white’s moves in the preceding position. While the move is neither the engine’s top choice, nor that of most grandmasters, it still leaves white with a small advantage. The objective of the move is to strengthen the center and enable a recapture with the pawn in the event of 4... cxd4. It is best for black to put more pressure on the d4 pawn before taking the pawn, which can best be done with the move 4... Nc6. } { [%csl Rd4][%cal Rc6d4,Gc5d4] } *
-
-
+[PGNTrainerOppositeSide "1"]
+[PGNTrainerRandomize "1"]
+[PGNTrainerFlipped "1"]
+[Event "Caro-Kann Defense"]
+[Result "*"]
+
+{ The Caro-Kann is considered solid and safe with a better pawn structure (often leading to good endgames). However, White has many possible responses and may develop faster than Black. Out of the Semi-Open games, the opening is thought to be less dynamic than the Sicilian and the French.
+
+In the traditional Open Game (1. e4 e5), many of the big threats that Black may face target the weak f7-square with White's bishop positioned on c4. And, Black often can consider this threat resolved if Black succeeds in pushing their queen pawn to d5. Thus, the idea of the Caro-Kann (as well as the French Defence) is to support a pushed queen pawn on d5 at the early stage in the opening. The Caro-Kann achieves this with 1...c6 (while the French does so via 1...e6).
+
+In choosing the Caro-Kann, Black gives up the centre in exchange for easier development. Black often aims to let White's pawns overextend, or develop a poor structure, and take advantage in the endgame. }
+1. e4 { [%cal Gc7c6] } 1... c6 2. d4 { [%cal Gd7d5] } 2... d5 { [%csl Rd5][%cal Ge4e5,Re4d5] } 3. e5 { [%cal Gc6c5] } (3. exd5 { White exchanges on d5, and black almost always responds with cxd5. This forms opposite-wing majorities.
+This usually will lead into a Panov-Botvinnik Attack, although independent lines can arise after 4.Bd3. } { [%cal Gc6d5] } 3... cxd5 4. Bd3 { [%cal Gb8c6] } 4... Nc6) 3... c5 { [%csl Rd4] } 4. c3 Nc6 { White’s most popular response to the Botvinnik-Carls Defense according to the Lichess database, accounting for more than half of white’s moves in the preceding position. While the move is neither the engine’s top choice, nor that of most grandmasters, it still leaves white with a small advantage. The objective of the move is to strengthen the center and enable a recapture with the pawn in the event of 4... cxd4. It is best for black to put more pressure on the d4 pawn before taking the pawn, which can best be done with the move 4... Nc6. } { [%csl Rd4][%cal Rc6d4,Gc5d4] } *
+
+
diff --git a/examples/Puzzle Example.pgn b/examples/Puzzle Example.pgn
old mode 100644
new mode 100755
index 40652e7..845e270
--- a/examples/Puzzle Example.pgn
+++ b/examples/Puzzle Example.pgn
@@ -1,19 +1,19 @@
-[PGNTrainerRandomize "1"]
-[PGNTrainerAnalysisLink "1"]
-[Event "Example 1"]
-[FEN "r1r1k3/5p2/3K4/2Q5/8/8/8/8 w - - 1 1"]
-
-{ [%csl Re8,Rc8,Ra8][%cal Gc5e5] }
-1. Qe5+ Kf8 { [%csl Rf8][%cal Be5h8,Bh8a8] } (1... Kd8 { [%csl Re7] } 2. Qe7#) 2. Qh8# { 1-0 White wins. } 1-0
-
-[Event "Example 2"]
-[FEN "r3k2r/ppp2ppp/8/8/4q3/8/PPP2PPP/R2Q1RK1 w kq - 0 1"]
-
-{ [%csl Re4,Re8][%cal Re1e8] }
-1. Re1 Qxe1+ (1... O-O 2. Rxe4) 2. Qxe1+ *
-
-[Event "Example 3"]
-[FEN "8/5bp1/5k2/8/4R3/8/7P/7K b - - 0 1"]
-
-{ [%csl Re4,Rh1][%cal Gf7d5] }
-1... Bd5 2. Kg1 (2. h3 Bxe4+) 2... Bxe4 *
+[PGNTrainerRandomize "1"]
+[PGNTrainerAnalysisLink "1"]
+[Event "Example 1"]
+[FEN "r1r1k3/5p2/3K4/2Q5/8/8/8/8 w - - 1 1"]
+
+{ [%csl Re8,Rc8,Ra8][%cal Gc5e5] }
+1. Qe5+ Kf8 { [%csl Rf8][%cal Be5h8,Bh8a8] } (1... Kd8 { [%csl Re7] } 2. Qe7#) 2. Qh8# { 1-0 White wins. } 1-0
+
+[Event "Example 2"]
+[FEN "r3k2r/ppp2ppp/8/8/4q3/8/PPP2PPP/R2Q1RK1 w kq - 0 1"]
+
+{ [%csl Re4,Re8][%cal Re1e8] }
+1. Re1 Qxe1+ (1... O-O 2. Rxe4) 2. Qxe1+ *
+
+[Event "Example 3"]
+[FEN "8/5bp1/5k2/8/4R3/8/7P/7K b - - 0 1"]
+
+{ [%csl Re4,Rh1][%cal Gf7d5] }
+1... Bd5 2. Kg1 (2. h3 Bxe4+) 2... Bxe4 *
diff --git a/examples/Queen's Gambit Declined.pgn b/examples/Queen's Gambit Declined.pgn
old mode 100644
new mode 100755
diff --git a/examples/Reset Mate - Both Sides.pgn b/examples/Reset Mate - Both Sides.pgn
old mode 100644
new mode 100755
index d38b5d4..4dd7ff8
--- a/examples/Reset Mate - Both Sides.pgn
+++ b/examples/Reset Mate - Both Sides.pgn
@@ -1,16 +1,16 @@
-[PGNTrainerNextButton "1"]
-[Event "Aman Hambleton's Reset Mate"]
-[FEN "8/2k5/8/8/8/8/8/RNBQKBNR w KQ - 0 1"]
-
-{ This is a ridiculous chekmate performed by GM Aman Hambleton. Check it out below:
-
-
-Assuming you can get enough pieces promoted and placed back in their starting positions, this is a disgusting way to checkmate your opponent. } { [%csl Bd2][%cal Bd1d2] }
-
-1. Qd2 { This is the only deviation from the original as Aman indicated that Qe2 can trigger stalemate if the king is on g3. Instead, having the Queen step forward one square instead of in front of the king prevents this. } Kc6 2. Qg2+ Kb6 3. Rh3 Kc7 4. Rf3 Kb6 5. Qg4 Kc7 6. Rf5 Kd8 7. Qg6 Ke7 8. Rf6 Kd8 9. Qg7 Ke8 10. Qf8+ Kd7 11. Rd6+ Kc7 12. Rd8 Kb6 13. Qe7 Kc6 14. Rd6+ Kc5 15. Qc7+ Kb4 16. Rd2 Kb3 17. Rh2 Kb4 18. Rh1 Kb3 19. Qd6 Kc2 { And now for the coup de grâce... } 20. Qd1#
-
-[Event "Aman Hambleton's Reset Mate"]
-[FEN "rnbqkbnr/8/6K1/8/8/8/8/8 b kq - 0 1"]
-
-{ Now the same thing for black } { [%csl Bd7][%cal Bd8d7] } 1... Qd7 2. Kg5 Qg7+ 3. Kf4 Rh6 4. Ke3 Rf6 5. Kd3 Qg5 6. Ke2 Rf4 7. Kd1 Qg3 8. Kc1 Rf3 9. Kd1 Qg2 10. Ke1 Qf1+ 11. Kd2 Rd3+ 12. Kc2 Rd1 13. Kc3 Qe2 14. Kb3 Rd3+ 15. Kc4 Qc2+ 16. Kb5 Rd7 17. Kb6 Rh7 18. Kb5 Rh8 19. Kb6 Qd3 20. Kc7 Qd8#
-
+[PGNTrainerNextButton "1"]
+[Event "Aman Hambleton's Reset Mate"]
+[FEN "8/2k5/8/8/8/8/8/RNBQKBNR w KQ - 0 1"]
+
+{ This is a ridiculous chekmate performed by GM Aman Hambleton. Check it out below:
+
+
+Assuming you can get enough pieces promoted and placed back in their starting positions, this is a disgusting way to checkmate your opponent. } { [%csl Bd2][%cal Bd1d2] }
+
+1. Qd2 { This is the only deviation from the original as Aman indicated that Qe2 can trigger stalemate if the king is on g3. Instead, having the Queen step forward one square instead of in front of the king prevents this. } Kc6 2. Qg2+ Kb6 3. Rh3 Kc7 4. Rf3 Kb6 5. Qg4 Kc7 6. Rf5 Kd8 7. Qg6 Ke7 8. Rf6 Kd8 9. Qg7 Ke8 10. Qf8+ Kd7 11. Rd6+ Kc7 12. Rd8 Kb6 13. Qe7 Kc6 14. Rd6+ Kc5 15. Qc7+ Kb4 16. Rd2 Kb3 17. Rh2 Kb4 18. Rh1 Kb3 19. Qd6 Kc2 { And now for the coup de grâce... } 20. Qd1#
+
+[Event "Aman Hambleton's Reset Mate"]
+[FEN "rnbqkbnr/8/6K1/8/8/8/8/8 b kq - 0 1"]
+
+{ Now the same thing for black } { [%csl Bd7][%cal Bd8d7] } 1... Qd7 2. Kg5 Qg7+ 3. Kf4 Rh6 4. Ke3 Rf6 5. Kd3 Qg5 6. Ke2 Rf4 7. Kd1 Qg3 8. Kc1 Rf3 9. Kd1 Qg2 10. Ke1 Qf1+ 11. Kd2 Rd3+ 12. Kc2 Rd1 13. Kc3 Qe2 14. Kb3 Rd3+ 15. Kc4 Qc2+ 16. Kb5 Rd7 17. Kb6 Rh7 18. Kb5 Rh8 19. Kb6 Qd3 20. Kc7 Qd8#
+
diff --git a/examples/The Immortal Game - anderssen_kieseritzky_1851.pgn b/examples/The Immortal Game - anderssen_kieseritzky_1851.pgn
old mode 100644
new mode 100755
index 02da2a1..7ac4f7e
--- a/examples/The Immortal Game - anderssen_kieseritzky_1851.pgn
+++ b/examples/The Immortal Game - anderssen_kieseritzky_1851.pgn
@@ -1,21 +1,21 @@
-[Event "The Immortal Game"]
-[Site "London ENG"]
-[Date "1851.06.21"]
-[EventDate "?"]
-[Round "?"]
-[Result "1-0"]
-[White "Adolf Anderssen"]
-[Black "Lionel Adalbert Bagration Felix Kieseritzky"]
-[ECO "C33"]
-[WhiteElo "?"]
-[BlackElo "?"]
-[Source "The Chess Player, vol.i no.1, 1851.07.19, p.2"]
-[PlyCount "45"]
-
-{ The Immortal Game was a chess game played in 1851 between Adolf Anderssen and Lionel Kieseritzky during the London 1851 chess tournament, an event in which both players participated. It was itself a casual game, however, not played as part of the tournament. Anderssen won the game by sacrificing all of his major pieces while developing a mating attack with his remaining minor pieces. Despite losing the game, Kieseritzky was impressed with Anderssen's performance. Kieseritzky published the game shortly thereafer in La Régence, a French chess journal which he helped to edit. Ernst Falkbeer published an analysis of the game in 1855, describing it for the first time with its sobriquet "immortal".
-
-Wikipedia }
-1. e4 e5 2. f4 { This is the King's Gambit: Anderssen offers his pawn in exchange for faster development. This was one of the most popular openings of the 19th century and is still occasionally seen, though defensive techniques have improved since Anderssen's time. } 2... exf4 3. Bc4 { The Bishop's Gambit; this line allows 3...Qh4+, depriving White of the right to castle, and is less popular than 3.Nf3. This check, however, also exposes Black's queen to attack with a gain of tempo on the eventual Ng1–f3. } 3... Qh4+ { [%cal Rh4e1,Bg1f3,Bf3h4] } 4. Kf1 b5?! { This is the Bryan Countergambit, deeply analysed by Kieseritzky, and which sometimes bears his name. It is not considered a sound move by most players today. } 5. Bxb5 Nf6 6. Nf3 { This is a common developing move, but in addition the knight attacks Black's queen, forcing Black to move it instead of developing his other pieces. } 6... Qh6 7. d3 { With this move, White solidifies control of the critical centre of the board. German grandmaster Robert Hübner recommends 7.Nc3 instead. } { [%cal Bb1c3] } 7... Nh5 { This move threatens ...Ng3+, and protects the pawn on f4, but also sidelines the knight to a poor position at the edge of the board, where knights are the least powerful, and does not develop a new piece. } { [%csl Rg3][%cal Rh5g3,Rg3f1,Rg3h1] } 8. Nh4 { [%cal Rg7g6] } 8... Qg5 { Better was 8...g6, according to Kieseritzky. } 9. Nf5 c6 { This simultaneously unpins the queen pawn and attacks the bishop. Modern chess engines suggest 9...g6 would be better, to deal with a very troublesome knight. } { [%cal Rg7g6] } 10. g4? Nf6 11. Rg1! { This is an advantageous passive piece sacrifice. If Black accepts, his queen will be boxed in, giving White a lead in development. } 11... cxb5? { Hübner believes this was Black's critical mistake; this gains material but lacks in development, at a point where White's strong development is able to quickly mount an offensive. Hübner recommends 11...h5 instead. } { [%cal Rh7h5] } 12. h4! { White's knight at f5 protects the pawn, which attacks Black's queen. } 12... Qg6 13. h5 Qg5 14. Qf3 { White now has two threats:
-
Bxf4, trapping Black's queen (the queen having no safe place to go);
e5, attacking Black's knight at f6 while simultaneously exposing an attack by White's queen on the unprotected black rook on a8.
} { [%cal Bc1f4,Be4e5] } 14... Ng8 { This deals with the threats, but undevelops Black even further—now the only black piece not on its starting square is the queen, which is about to be put on the run, while White has control over a great deal of the board. } 15. Bxf4 Qf6 16. Nc3 Bc5 { An ordinary developing move by Black, which also attacks the rook at g1. } 17. Nd5 { White responds to the attack with a counterattack. This move threatens the black queen and also Nc7+, forking the king and rook. Richard Réti recommends 17.d4 followed by 18.Nd5, with advantage to White, although if 17.d4 Bf8 then 18.Be5 would be a stronger move. } { [%cal Rd5c7,Rc7e8,Rc7a8,Bd3d4,Bc3d5,Rc5f8,Bf4e5] } 17... Qxb2 { Black gains a pawn, and threatens to gain the rook on a1 with check. } 18. Bd6! { With this move White offers to sacrifice both of his rooks. Hübner comments that, from this position, there are actually many ways to win, and he believes there are at least three better moves than 18.Bd6: 18.d4, 18.Be3, or 18.Re1, which lead to strong positions or checkmate without needing to sacrifice so much material. The Chessmaster computer program annotation says "the main point [of 18. Bd6] is to divert the black queen from the a1–h8 diagonal. Now Black cannot play 18...Bxd6? 19.Nxd6+ Kd8 20.Nxf7+ Ke8 21.Nd6+ Kd8 22.Qf8#." Garry Kasparov comments that the world of chess would have lost one of its "crown jewels" if the game had continued in such an unspectacular fashion. 18. Bd6! is surprising, because White is willing to give up so much material. } 18... Bxg1? { Wilhelm Steinitz suggested in 1879 that a better move would be 18...Qxa1+; likely moves to follow are 19.Ke2 Qb2 20.Kd2 Bxg1. The continuation played is still winning for White, however, despite having many complications. The variation continues 21.e5! Ba6 22.Bb4! Qxe5 (22...Be3+ 23.Qxe3 +/−; 22...Nh6 23.Nd6+ Kf8 24.g5 +−) 23.Nd6+ Qxd6 24.Bxd6 +/−. } { [%csl Rb1][%cal Rb2a1,Ra1f1,Gf1e2,Ge2d2] } 19. e5! { This sacrifices yet another white rook. More importantly, this move blocks the queen from participating in the defense of the king, and threatens mate in two: 20.Nxg7+ Kd8 21.Bc7#. } { [%csl Gc7,Ge8][%cal Gf5g7,Gg7e8,Re8d8,Gd6e7] } 19... Qxa1+ 20. Ke2 { At this point, Black's attack has run out of steam; Black has a queen and bishop on White's back rank, but cannot effectively mount an immediate attack on White, while White can storm forward. According to Kieseritzky, he resigned at this point. Hübner notes that an article by Friedrich Amelung in the journal Baltische Schachblaetter, 1893, reported that Kiesertizky probably played 20...Na6, but Anderssen then announced the mating moves. The Oxford Companion to Chess also says that Black resigned at this point, citing an 1851 publication. In any case, it is suspected that the last few moves were not actually played on the board in the original game. } 20... Na6 { The black knight covers c7 as White was threatening 21.Nxg7+ Kd8 22.Bc7#. Another attempt to defend is 20...Ba6, allowing the black king to flee via c8 and b7, although White has enough with the continuation 21.Nc7+ Kd8 and 22.Nxa6, where if now 22...Qxa2 (to defend f7 against Bc7+, Nd6+ and Qxf7#) White can play 23.Bc7+ Ke8 24.Nb4, winning; or, if 22...Bb6 (stopping Bc7+), 23.Qxa8 Qc3 24.Qxb8+ Qc8 25.Qxc8+ Kxc8 26.Bf8 h6 27.Nd6+ Kd8 28.Nxf7+ Ke8 29.Nxh8 Kxf8, with a winning endgame for White. } { [%cal Ra6c7,Gd5c7] } 21. Nxg7+ Kd8 22. Qf6+! { This queen sacrifice forces Black to give up his defense of e7. } 22... Nxf6 23. Be7# { At the end, Black is ahead in material by a considerable margin: a queen, two rooks, and a bishop. But the material does not help Black. White has been able to use his remaining pieces—two knights and a bishop—to force mate. } 1-0
-
-
+[Event "The Immortal Game"]
+[Site "London ENG"]
+[Date "1851.06.21"]
+[EventDate "?"]
+[Round "?"]
+[Result "1-0"]
+[White "Adolf Anderssen"]
+[Black "Lionel Adalbert Bagration Felix Kieseritzky"]
+[ECO "C33"]
+[WhiteElo "?"]
+[BlackElo "?"]
+[Source "The Chess Player, vol.i no.1, 1851.07.19, p.2"]
+[PlyCount "45"]
+
+{ The Immortal Game was a chess game played in 1851 between Adolf Anderssen and Lionel Kieseritzky during the London 1851 chess tournament, an event in which both players participated. It was itself a casual game, however, not played as part of the tournament. Anderssen won the game by sacrificing all of his major pieces while developing a mating attack with his remaining minor pieces. Despite losing the game, Kieseritzky was impressed with Anderssen's performance. Kieseritzky published the game shortly thereafer in La Régence, a French chess journal which he helped to edit. Ernst Falkbeer published an analysis of the game in 1855, describing it for the first time with its sobriquet "immortal".
+
+Wikipedia }
+1. e4 e5 2. f4 { This is the King's Gambit: Anderssen offers his pawn in exchange for faster development. This was one of the most popular openings of the 19th century and is still occasionally seen, though defensive techniques have improved since Anderssen's time. } 2... exf4 3. Bc4 { The Bishop's Gambit; this line allows 3...Qh4+, depriving White of the right to castle, and is less popular than 3.Nf3. This check, however, also exposes Black's queen to attack with a gain of tempo on the eventual Ng1–f3. } 3... Qh4+ { [%cal Rh4e1,Bg1f3,Bf3h4] } 4. Kf1 b5?! { This is the Bryan Countergambit, deeply analysed by Kieseritzky, and which sometimes bears his name. It is not considered a sound move by most players today. } 5. Bxb5 Nf6 6. Nf3 { This is a common developing move, but in addition the knight attacks Black's queen, forcing Black to move it instead of developing his other pieces. } 6... Qh6 7. d3 { With this move, White solidifies control of the critical centre of the board. German grandmaster Robert Hübner recommends 7.Nc3 instead. } { [%cal Bb1c3] } 7... Nh5 { This move threatens ...Ng3+, and protects the pawn on f4, but also sidelines the knight to a poor position at the edge of the board, where knights are the least powerful, and does not develop a new piece. } { [%csl Rg3][%cal Rh5g3,Rg3f1,Rg3h1] } 8. Nh4 { [%cal Rg7g6] } 8... Qg5 { Better was 8...g6, according to Kieseritzky. } 9. Nf5 c6 { This simultaneously unpins the queen pawn and attacks the bishop. Modern chess engines suggest 9...g6 would be better, to deal with a very troublesome knight. } { [%cal Rg7g6] } 10. g4? Nf6 11. Rg1! { This is an advantageous passive piece sacrifice. If Black accepts, his queen will be boxed in, giving White a lead in development. } 11... cxb5? { Hübner believes this was Black's critical mistake; this gains material but lacks in development, at a point where White's strong development is able to quickly mount an offensive. Hübner recommends 11...h5 instead. } { [%cal Rh7h5] } 12. h4! { White's knight at f5 protects the pawn, which attacks Black's queen. } 12... Qg6 13. h5 Qg5 14. Qf3 { White now has two threats:
+
Bxf4, trapping Black's queen (the queen having no safe place to go);
e5, attacking Black's knight at f6 while simultaneously exposing an attack by White's queen on the unprotected black rook on a8.
} { [%cal Bc1f4,Be4e5] } 14... Ng8 { This deals with the threats, but undevelops Black even further—now the only black piece not on its starting square is the queen, which is about to be put on the run, while White has control over a great deal of the board. } 15. Bxf4 Qf6 16. Nc3 Bc5 { An ordinary developing move by Black, which also attacks the rook at g1. } 17. Nd5 { White responds to the attack with a counterattack. This move threatens the black queen and also Nc7+, forking the king and rook. Richard Réti recommends 17.d4 followed by 18.Nd5, with advantage to White, although if 17.d4 Bf8 then 18.Be5 would be a stronger move. } { [%cal Rd5c7,Rc7e8,Rc7a8,Bd3d4,Bc3d5,Rc5f8,Bf4e5] } 17... Qxb2 { Black gains a pawn, and threatens to gain the rook on a1 with check. } 18. Bd6! { With this move White offers to sacrifice both of his rooks. Hübner comments that, from this position, there are actually many ways to win, and he believes there are at least three better moves than 18.Bd6: 18.d4, 18.Be3, or 18.Re1, which lead to strong positions or checkmate without needing to sacrifice so much material. The Chessmaster computer program annotation says "the main point [of 18. Bd6] is to divert the black queen from the a1–h8 diagonal. Now Black cannot play 18...Bxd6? 19.Nxd6+ Kd8 20.Nxf7+ Ke8 21.Nd6+ Kd8 22.Qf8#." Garry Kasparov comments that the world of chess would have lost one of its "crown jewels" if the game had continued in such an unspectacular fashion. 18. Bd6! is surprising, because White is willing to give up so much material. } 18... Bxg1? { Wilhelm Steinitz suggested in 1879 that a better move would be 18...Qxa1+; likely moves to follow are 19.Ke2 Qb2 20.Kd2 Bxg1. The continuation played is still winning for White, however, despite having many complications. The variation continues 21.e5! Ba6 22.Bb4! Qxe5 (22...Be3+ 23.Qxe3 +/−; 22...Nh6 23.Nd6+ Kf8 24.g5 +−) 23.Nd6+ Qxd6 24.Bxd6 +/−. } { [%csl Rb1][%cal Rb2a1,Ra1f1,Gf1e2,Ge2d2] } 19. e5! { This sacrifices yet another white rook. More importantly, this move blocks the queen from participating in the defense of the king, and threatens mate in two: 20.Nxg7+ Kd8 21.Bc7#. } { [%csl Gc7,Ge8][%cal Gf5g7,Gg7e8,Re8d8,Gd6e7] } 19... Qxa1+ 20. Ke2 { At this point, Black's attack has run out of steam; Black has a queen and bishop on White's back rank, but cannot effectively mount an immediate attack on White, while White can storm forward. According to Kieseritzky, he resigned at this point. Hübner notes that an article by Friedrich Amelung in the journal Baltische Schachblaetter, 1893, reported that Kiesertizky probably played 20...Na6, but Anderssen then announced the mating moves. The Oxford Companion to Chess also says that Black resigned at this point, citing an 1851 publication. In any case, it is suspected that the last few moves were not actually played on the board in the original game. } 20... Na6 { The black knight covers c7 as White was threatening 21.Nxg7+ Kd8 22.Bc7#. Another attempt to defend is 20...Ba6, allowing the black king to flee via c8 and b7, although White has enough with the continuation 21.Nc7+ Kd8 and 22.Nxa6, where if now 22...Qxa2 (to defend f7 against Bc7+, Nd6+ and Qxf7#) White can play 23.Bc7+ Ke8 24.Nb4, winning; or, if 22...Bb6 (stopping Bc7+), 23.Qxa8 Qc3 24.Qxb8+ Qc8 25.Qxc8+ Kxc8 26.Bf8 h6 27.Nd6+ Kd8 28.Nxf7+ Ke8 29.Nxh8 Kxf8, with a winning endgame for White. } { [%cal Ra6c7,Gd5c7] } 21. Nxg7+ Kd8 22. Qf6+! { This queen sacrifice forces Black to give up his defense of e7. } 22... Nxf6 23. Be7# { At the end, Black is ahead in material by a considerable margin: a queen, two rooks, and a bishop. But the material does not help Black. White has been able to use his remaining pieces—two knights and a bishop—to force mate. } 1-0
+
+
diff --git a/examples/The Opera Game - morphy_duke_karl_count_isouard_1858.pgn b/examples/The Opera Game - morphy_duke_karl_count_isouard_1858.pgn
old mode 100644
new mode 100755
index 032d09b..161d958
--- a/examples/The Opera Game - morphy_duke_karl_count_isouard_1858.pgn
+++ b/examples/The Opera Game - morphy_duke_karl_count_isouard_1858.pgn
@@ -1,22 +1,22 @@
-[Event "The Opera Game"]
-[Site "Paris FRA"]
-[Date "1858.??.??"]
-[EventDate "?"]
-[Round "?"]
-[Result "1-0"]
-[White "Paul Morphy"]
-[Black "Duke Karl / Count Isouard"]
-[ECO "C41"]
-[WhiteElo "?"]
-[BlackElo "?"]
-[PlyCount "33"]
-
-{ The Opera Game was a chess game played in 1858 at an opera house in Paris. The American master Paul Morphy played against two amateurs: the German noble Karl II, Duke of Brunswick, and the French aristocrat Comte Isouard de Vauvenargues. It was played as a consultation game, with Duke Karl and Count Isouard jointly deciding each move for the black pieces, while Morphy controlled the white pieces by himself. The game was played in a box while an opera was performed on stage. Morphy quickly checkmated his opponents following rapid development and sacrifice of material, including a queen sacrifice.
-
-It is among the most famous of chess games. The game is often used by chess instructors to teach the importance of piece development, the value of sacrifices in mating combinations, and other concepts.
-
-Wikipedia } { [%cal Ge2e4] }
-1. e4 e5 2. Nf3 d6 { This is Philidor's Defence, named after François-André Danican Philidor, the leading chess master of the second half of the 18th century and a pioneer of modern chess strategy. He was also a noted opera composer. It is a solid opening, but slightly passive, and it ignores the important d4-square. Most modern players prefer 2...Nc6 or 2...Nf6, Petrov's Defence. } { [%cal Gd6e5] } 3. d4 { [%cal Gd4e5,Rd6e5] } 3... Bg4?! { Though common at the time, 3...Bg4 is now considered inferior. Bobby Fischer, in his analysis of the game, called it a weak move. Today 3...exd4 or 3...Nf6 are more commonly played. Philidor's original idea, 3...f5, is a risky alternative. } 4. dxe5 Bxf3 { If 4...dxe5, then 5.Qxd8+ Kxd8 6.Nxe5 and White wins a pawn and Black has lost the ability to castle, and White is threatening Nxf7+ winning the rook. If 4...Qe7, White remains a pawn up with 5.Qd5. Black, however, did have the option of 4...Nd7 5.exd6 Bxd6. In this position, Black is down a pawn but has some compensation in the form of better development. } { [%cal Gg2f3,Gd1f3] } 5. Qxf3 { Steinitz's recommendation 5.gxf3 dxe5 6.Qxd8+ Kxd8 7.f4 is also good, but Morphy prefers to keep the queens on. After Black recaptures the pawn on e5, White has a significant lead in development. A recapture with the queen is the most natural as it keeps a healthy kingside pawn structure. } 5... dxe5 { [%cal Rd8d1] } 6. Bc4 Nf6? { This seemingly sound developing move runs into a surprising refutation. After White's next move, both f7 and b7 will be under attack. Better would have been to directly protect the f7-pawn with 6...Qd7 or 6...Qf6, making White's next move less potent. } { [%cal Rf6e4,Rf6d5] } 7. Qb3 Qe7 { Black's only reasonable move. White was threatening mate in two, for example, 7...Nc6 8.Bxf7+ Ke7 (or Kd7) 9.Qe6#. 7...Qd7 loses the rook to 8.Qxb7 followed by 9.Qxa8 (since 8...Qc6? would lose the queen to 9.Bb5).
-Although this move prevents immediate disaster, Black blocks the f8-bishop, impeding development and kingside castling. } 8. Nc3 { Morphy could have won a pawn by 8.Qxb7 Qb4+ 9.Qxb4 Bxb4+. White can also win more material with 8.Bxf7+ Qxf7 9.Qxb7, but Black has dangerous counterplay after 9...Bc5! and 10.Qxa8 0-0, or 10.Qc8+ Ke7 11.Qxh8 Bxf2+!. "But that would have been a butcher’s method, not an artist's." (Lasker). In keeping with his style, Morphy prefers rapid development and initiative over material. } 8... c6 { The best move, allowing Black to defend his pawn while strengthening the light squares, which have already been weakened by Black trading off his light-square bishop. } { [%csl Rf6,Re7] } 9. Bg5 b5? { Black attempts to drive away the bishop and gain some time, but this move allows Morphy a strong sacrifice to keep the initiative. This move loses but it is difficult to find anything better; for example 9...Na6 10.Bxf6 gxf6 11.Bxa6 bxa6 12.Qa4 Qb7 and Black's position is very weak. } { [%cal Bc4b5,Bc3b5,Bb3b5] } 10. Nxb5! { Morphy chooses not to retreat the bishop, which would allow Black to gain time for development. } 10... cxb5 { Black could have prolonged the game by playing 10...Qb4+, forcing the exchange of queens, but White wins comfortably after either 11.Nc3 or 11.Qxb4 Bxb4+ 12.c3! } 11. Bxb5+ { Not 11.Bd5? Qb4+, unpinning the knight and allowing the rook to evade capture. } 11... Nbd7 { 11...Kd8 holds out longer, but 12.O-O-O+ still gives White a winning attack. } 12. O-O-O Rd8 { The combination of the pins on the knights and the open file for White's rook will lead to Black's defeat. } 13. Rxd7 Rxd7 { Removing another defender. } 14. Rd1 { White's piece activity is in marked contrast to Black's passivity. Black's d7-rook cannot be saved, since it is pinned to the king by the bishop and attacked by the rook, and though the knight defends it, the knight is pinned to the queen. } 14... Qe6 { Qe6 is a futile attempt to unpin the knight (allowing it to defend the rook) and offer a queen trade, to take some pressure out of the white attack. Even if Morphy did not play his next crushing move, he could have always traded his bishop for the knight, followed by winning the rook. } 15. Bxd7+ Nxd7 { If 15...Qxd7, then 16.Qb8+ Ke7 17.Qxe5+ Kd8 18.Bxf6+ gxf6 19.Qxf6+ Kc8 20.Rxd7 Kxd7 21.Qxh8 and White is clearly winning. Moving the king leads to mate: 15...Ke7 16.Qb4+ Qd6 (16...Kd8 17.Qb8+ Ke7 18.Qe8#) 17.Qxd6+ Kd8 18.Qb8+ Ke7 19.Qe8# or 15...Kd8 16.Qb8+ Ke7 17.Qe8#. } 16. Qb8+! { Morphy finishes with a queen sacrifice. } 16... Nxb8 17. Rd8# { 1-0 White wins. } 1-0
-
-
+[Event "The Opera Game"]
+[Site "Paris FRA"]
+[Date "1858.??.??"]
+[EventDate "?"]
+[Round "?"]
+[Result "1-0"]
+[White "Paul Morphy"]
+[Black "Duke Karl / Count Isouard"]
+[ECO "C41"]
+[WhiteElo "?"]
+[BlackElo "?"]
+[PlyCount "33"]
+
+{ The Opera Game was a chess game played in 1858 at an opera house in Paris. The American master Paul Morphy played against two amateurs: the German noble Karl II, Duke of Brunswick, and the French aristocrat Comte Isouard de Vauvenargues. It was played as a consultation game, with Duke Karl and Count Isouard jointly deciding each move for the black pieces, while Morphy controlled the white pieces by himself. The game was played in a box while an opera was performed on stage. Morphy quickly checkmated his opponents following rapid development and sacrifice of material, including a queen sacrifice.
+
+It is among the most famous of chess games. The game is often used by chess instructors to teach the importance of piece development, the value of sacrifices in mating combinations, and other concepts.
+
+Wikipedia } { [%cal Ge2e4] }
+1. e4 e5 2. Nf3 d6 { This is Philidor's Defence, named after François-André Danican Philidor, the leading chess master of the second half of the 18th century and a pioneer of modern chess strategy. He was also a noted opera composer. It is a solid opening, but slightly passive, and it ignores the important d4-square. Most modern players prefer 2...Nc6 or 2...Nf6, Petrov's Defence. } { [%cal Gd6e5] } 3. d4 { [%cal Gd4e5,Rd6e5] } 3... Bg4?! { Though common at the time, 3...Bg4 is now considered inferior. Bobby Fischer, in his analysis of the game, called it a weak move. Today 3...exd4 or 3...Nf6 are more commonly played. Philidor's original idea, 3...f5, is a risky alternative. } 4. dxe5 Bxf3 { If 4...dxe5, then 5.Qxd8+ Kxd8 6.Nxe5 and White wins a pawn and Black has lost the ability to castle, and White is threatening Nxf7+ winning the rook. If 4...Qe7, White remains a pawn up with 5.Qd5. Black, however, did have the option of 4...Nd7 5.exd6 Bxd6. In this position, Black is down a pawn but has some compensation in the form of better development. } { [%cal Gg2f3,Gd1f3] } 5. Qxf3 { Steinitz's recommendation 5.gxf3 dxe5 6.Qxd8+ Kxd8 7.f4 is also good, but Morphy prefers to keep the queens on. After Black recaptures the pawn on e5, White has a significant lead in development. A recapture with the queen is the most natural as it keeps a healthy kingside pawn structure. } 5... dxe5 { [%cal Rd8d1] } 6. Bc4 Nf6? { This seemingly sound developing move runs into a surprising refutation. After White's next move, both f7 and b7 will be under attack. Better would have been to directly protect the f7-pawn with 6...Qd7 or 6...Qf6, making White's next move less potent. } { [%cal Rf6e4,Rf6d5] } 7. Qb3 Qe7 { Black's only reasonable move. White was threatening mate in two, for example, 7...Nc6 8.Bxf7+ Ke7 (or Kd7) 9.Qe6#. 7...Qd7 loses the rook to 8.Qxb7 followed by 9.Qxa8 (since 8...Qc6? would lose the queen to 9.Bb5).
+Although this move prevents immediate disaster, Black blocks the f8-bishop, impeding development and kingside castling. } 8. Nc3 { Morphy could have won a pawn by 8.Qxb7 Qb4+ 9.Qxb4 Bxb4+. White can also win more material with 8.Bxf7+ Qxf7 9.Qxb7, but Black has dangerous counterplay after 9...Bc5! and 10.Qxa8 0-0, or 10.Qc8+ Ke7 11.Qxh8 Bxf2+!. "But that would have been a butcher’s method, not an artist's." (Lasker). In keeping with his style, Morphy prefers rapid development and initiative over material. } 8... c6 { The best move, allowing Black to defend his pawn while strengthening the light squares, which have already been weakened by Black trading off his light-square bishop. } { [%csl Rf6,Re7] } 9. Bg5 b5? { Black attempts to drive away the bishop and gain some time, but this move allows Morphy a strong sacrifice to keep the initiative. This move loses but it is difficult to find anything better; for example 9...Na6 10.Bxf6 gxf6 11.Bxa6 bxa6 12.Qa4 Qb7 and Black's position is very weak. } { [%cal Bc4b5,Bc3b5,Bb3b5] } 10. Nxb5! { Morphy chooses not to retreat the bishop, which would allow Black to gain time for development. } 10... cxb5 { Black could have prolonged the game by playing 10...Qb4+, forcing the exchange of queens, but White wins comfortably after either 11.Nc3 or 11.Qxb4 Bxb4+ 12.c3! } 11. Bxb5+ { Not 11.Bd5? Qb4+, unpinning the knight and allowing the rook to evade capture. } 11... Nbd7 { 11...Kd8 holds out longer, but 12.O-O-O+ still gives White a winning attack. } 12. O-O-O Rd8 { The combination of the pins on the knights and the open file for White's rook will lead to Black's defeat. } 13. Rxd7 Rxd7 { Removing another defender. } 14. Rd1 { White's piece activity is in marked contrast to Black's passivity. Black's d7-rook cannot be saved, since it is pinned to the king by the bishop and attacked by the rook, and though the knight defends it, the knight is pinned to the queen. } 14... Qe6 { Qe6 is a futile attempt to unpin the knight (allowing it to defend the rook) and offer a queen trade, to take some pressure out of the white attack. Even if Morphy did not play his next crushing move, he could have always traded his bishop for the knight, followed by winning the rook. } 15. Bxd7+ Nxd7 { If 15...Qxd7, then 16.Qb8+ Ke7 17.Qxe5+ Kd8 18.Bxf6+ gxf6 19.Qxf6+ Kc8 20.Rxd7 Kxd7 21.Qxh8 and White is clearly winning. Moving the king leads to mate: 15...Ke7 16.Qb4+ Qd6 (16...Kd8 17.Qb8+ Ke7 18.Qe8#) 17.Qxd6+ Kd8 18.Qb8+ Ke7 19.Qe8# or 15...Kd8 16.Qb8+ Ke7 17.Qe8#. } 16. Qb8+! { Morphy finishes with a queen sacrifice. } 16... Nxb8 17. Rd8# { 1-0 White wins. } 1-0
+
+
diff --git a/examples/White Opening Example.pgn b/examples/White Opening Example.pgn
old mode 100644
new mode 100755
index 111df91..f6b2fbb
--- a/examples/White Opening Example.pgn
+++ b/examples/White Opening Example.pgn
@@ -1,29 +1,29 @@
-[PGNTrainerRandomize "1"]
-[Event "King's Pawn Opening: King's Knight Variation"]
-[Site "?"]
-[Date "????.??.??"]
-[Round "?"]
-[White "?"]
-[Black "?"]
-[Result "*"]
-
-{ Black develops the Knight to c6, defending the black e5 pawn while also fighting for control of d4.
-
-White now can choose between several well known openings. Ruy Lopez (Bb5) , Italian (Bc4) and Scotch (d4) are all solid openings that see regular play at all levels. With Ruy Lopez, white seeks to immediately chase the initiative and attacks the defender of the black e5 pawn. While in Italian the Bishop on c4 target's the black f7 pawn, the weakest pawn in the starting position. Scotch with d4, instead often lead to more concrete variations, starting with the pawns getting exchanged right away. } { [%cal Ge2e4] }
-1. e4 { [%cal Re7e5] } 1... e5 { [%cal Gg1f3] } 2. Nf3 { Nf3 is the classic of all classic moves. The knight on f3 immediately fights for control of the center, by attacking the black e5 pawn. It also serves as supporting a potential d2-d4 move. Across many openings, it's common to develop the knight before the bishop. This is because, there is usually only one good square for the knight, while the bishop have several options. We can see this exemplified in black's most common response, Nc6.
-After 2... Nc6, to defend the black e5 pawn, white can place the Bishop on b5 or c4. That is either Ruy Lopez or the Italian game. } { [%cal Rb8c6] } 2... Nc6 { Black develops the Knight to c6, defending the black e5 pawn while also fighting for control of d4.
-White now can choose between several well known openings. Ruy Lopez (Bb5) , Italian (Bc4) and Scotch (d4) are all solid openings that see regular play at all levels. With Ruy Lopez, white seeks to immediately chase the initiative and attacks the defender of the black e5 pawn. While in Italian the Bishop on c4 target's the black f7 pawn, the weakest pawn in the starting position. Scotch with d4, instead often lead to more concrete variations, starting with the pawns getting exchanged right away. } *
-
-[Event "Open Sicilian with 2...Nc6"]
-[Site "?"]
-[Date "????.??.??"]
-[Round "?"]
-[White "?"]
-[Black "?"]
-[Result "*"]
-
-{ The Open Sicilian is a very popular opening. There is a great deal of theory on the opening and it is also typically very tactical. For these two reasons some people who do not play the Sicilian will avoid playing the Open Sicilian to encourage slower maneuvering instead of sharp tactics. } { [%csl Ge4][%cal Ge2e4] }
-1. e4 { [%cal Rc7c5] } 1... c5 { [%csl Gf3][%cal Gg1f3] } 2. Nf3 { [%csl Rc6,Rg6][%cal Rb8c6,Rg7g6] } 2... Nc6 { 2. ...Nc6 continues development and covers the d4 and e5 squares while still keeping retaining the option to push either d5 or e5 in one move.
-Within the Open Sicilians after 3. d4 it is most frequently used as the move order to reach a Sveshnikov setup after a subsequent 3. ...cxd 4. Nxd Nf6 5. Nc3 e5 - where the central pressure and threat of Bb4 force White into the complications that arise from 6. Ndb5. Another very important option is the Accelerated Dragon after 3. d4 cxd 4. Nxd g6 - where the purpose of Nc6 was to rule out a White Qxd4. } { [%csl Gc5][%cal Gd2d4,Gd4c5] } (2... g6 { This early g6 in the Sicilian signifies the Hyper-Accelerated Dragon, also called the Hungarian variation (not to be mistaken with the Hungarian Defense, which appears after 1.e4 e5 2.Nf3 Nc6 3.Bc4 Be7). The main idea in the Hyper-Accelerated Dragon (HAD) is to delay d6, in order to be able to play the liberating d5 push in one go. This move is a gambit but is sound and is considered mainline. The advantage of this is that if white goes for the classical moves 3.d4 c.cxd4 4.Nxd4 Nc6 5.Nc3, Black can choose to prevent White from having the usual setup with Be3, Bc4, Qd2, and O-O-O. He can also transpose back into the regular dragon by playing d6.
-The main drawback of this variation is that having delayed Nf6, White can play c4 before Nc3, setting up a Maroczy bind. The position is still equal, but black must know how to respond effectively, because it is easy to suffocate in this cramped position. } { [%csl Gd4][%cal Gd2d4] } 3. d4) 3. d4 *
-
+[PGNTrainerRandomize "1"]
+[Event "King's Pawn Opening: King's Knight Variation"]
+[Site "?"]
+[Date "????.??.??"]
+[Round "?"]
+[White "?"]
+[Black "?"]
+[Result "*"]
+
+{ Black develops the Knight to c6, defending the black e5 pawn while also fighting for control of d4.
+
+White now can choose between several well known openings. Ruy Lopez (Bb5) , Italian (Bc4) and Scotch (d4) are all solid openings that see regular play at all levels. With Ruy Lopez, white seeks to immediately chase the initiative and attacks the defender of the black e5 pawn. While in Italian the Bishop on c4 target's the black f7 pawn, the weakest pawn in the starting position. Scotch with d4, instead often lead to more concrete variations, starting with the pawns getting exchanged right away. } { [%cal Ge2e4] }
+1. e4 { [%cal Re7e5] } 1... e5 { [%cal Gg1f3] } 2. Nf3 { Nf3 is the classic of all classic moves. The knight on f3 immediately fights for control of the center, by attacking the black e5 pawn. It also serves as supporting a potential d2-d4 move. Across many openings, it's common to develop the knight before the bishop. This is because, there is usually only one good square for the knight, while the bishop have several options. We can see this exemplified in black's most common response, Nc6.
+After 2... Nc6, to defend the black e5 pawn, white can place the Bishop on b5 or c4. That is either Ruy Lopez or the Italian game. } { [%cal Rb8c6] } 2... Nc6 { Black develops the Knight to c6, defending the black e5 pawn while also fighting for control of d4.
+White now can choose between several well known openings. Ruy Lopez (Bb5) , Italian (Bc4) and Scotch (d4) are all solid openings that see regular play at all levels. With Ruy Lopez, white seeks to immediately chase the initiative and attacks the defender of the black e5 pawn. While in Italian the Bishop on c4 target's the black f7 pawn, the weakest pawn in the starting position. Scotch with d4, instead often lead to more concrete variations, starting with the pawns getting exchanged right away. } *
+
+[Event "Open Sicilian with 2...Nc6"]
+[Site "?"]
+[Date "????.??.??"]
+[Round "?"]
+[White "?"]
+[Black "?"]
+[Result "*"]
+
+{ The Open Sicilian is a very popular opening. There is a great deal of theory on the opening and it is also typically very tactical. For these two reasons some people who do not play the Sicilian will avoid playing the Open Sicilian to encourage slower maneuvering instead of sharp tactics. } { [%csl Ge4][%cal Ge2e4] }
+1. e4 { [%cal Rc7c5] } 1... c5 { [%csl Gf3][%cal Gg1f3] } 2. Nf3 { [%csl Rc6,Rg6][%cal Rb8c6,Rg7g6] } 2... Nc6 { 2. ...Nc6 continues development and covers the d4 and e5 squares while still keeping retaining the option to push either d5 or e5 in one move.
+Within the Open Sicilians after 3. d4 it is most frequently used as the move order to reach a Sveshnikov setup after a subsequent 3. ...cxd 4. Nxd Nf6 5. Nc3 e5 - where the central pressure and threat of Bb4 force White into the complications that arise from 6. Ndb5. Another very important option is the Accelerated Dragon after 3. d4 cxd 4. Nxd g6 - where the purpose of Nc6 was to rule out a White Qxd4. } { [%csl Gc5][%cal Gd2d4,Gd4c5] } (2... g6 { This early g6 in the Sicilian signifies the Hyper-Accelerated Dragon, also called the Hungarian variation (not to be mistaken with the Hungarian Defense, which appears after 1.e4 e5 2.Nf3 Nc6 3.Bc4 Be7). The main idea in the Hyper-Accelerated Dragon (HAD) is to delay d6, in order to be able to play the liberating d5 push in one go. This move is a gambit but is sound and is considered mainline. The advantage of this is that if white goes for the classical moves 3.d4 c.cxd4 4.Nxd4 Nc6 5.Nc3, Black can choose to prevent White from having the usual setup with Be3, Bc4, Qd2, and O-O-O. He can also transpose back into the regular dragon by playing d6.
+The main drawback of this variation is that having delayed Nf6, White can play c4 before Nc3, setting up a Maroczy bind. The position is still equal, but black must know how to respond effectively, because it is easy to suffocate in this cramped position. } { [%csl Gd4][%cal Gd2d4] } 3. d4) 3. d4 *
+
diff --git a/favicon.ico b/favicon.ico
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bB.svg b/img/chesspieces/alpha/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bK.svg b/img/chesspieces/alpha/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bN.svg b/img/chesspieces/alpha/bN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bP.svg b/img/chesspieces/alpha/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bQ.svg b/img/chesspieces/alpha/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/bR.svg b/img/chesspieces/alpha/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wB.svg b/img/chesspieces/alpha/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wK.svg b/img/chesspieces/alpha/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wN.svg b/img/chesspieces/alpha/wN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wP.svg b/img/chesspieces/alpha/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wQ.svg b/img/chesspieces/alpha/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/alpha/wR.svg b/img/chesspieces/alpha/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bB.svg b/img/chesspieces/cburnett/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bK.svg b/img/chesspieces/cburnett/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bN.svg b/img/chesspieces/cburnett/bN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bP.svg b/img/chesspieces/cburnett/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bQ.svg b/img/chesspieces/cburnett/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/bR.svg b/img/chesspieces/cburnett/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wB.svg b/img/chesspieces/cburnett/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wK.svg b/img/chesspieces/cburnett/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wN.svg b/img/chesspieces/cburnett/wN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wP.svg b/img/chesspieces/cburnett/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wQ.svg b/img/chesspieces/cburnett/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/cburnett/wR.svg b/img/chesspieces/cburnett/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bB.svg b/img/chesspieces/chessnut/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bK.svg b/img/chesspieces/chessnut/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bN.svg b/img/chesspieces/chessnut/bN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bP.svg b/img/chesspieces/chessnut/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bQ.svg b/img/chesspieces/chessnut/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/bR.svg b/img/chesspieces/chessnut/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wB.svg b/img/chesspieces/chessnut/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wK.svg b/img/chesspieces/chessnut/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wN.svg b/img/chesspieces/chessnut/wN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wP.svg b/img/chesspieces/chessnut/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wQ.svg b/img/chesspieces/chessnut/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/chessnut/wR.svg b/img/chesspieces/chessnut/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bB.svg b/img/chesspieces/merida/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bK.svg b/img/chesspieces/merida/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bN.svg b/img/chesspieces/merida/bN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bP.svg b/img/chesspieces/merida/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bQ.svg b/img/chesspieces/merida/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/bR.svg b/img/chesspieces/merida/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wB.svg b/img/chesspieces/merida/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wK.svg b/img/chesspieces/merida/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wN.svg b/img/chesspieces/merida/wN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wP.svg b/img/chesspieces/merida/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wQ.svg b/img/chesspieces/merida/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/merida/wR.svg b/img/chesspieces/merida/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/bB.svg b/img/chesspieces/staunty/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/bK.svg b/img/chesspieces/staunty/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/bN.svg b/img/chesspieces/staunty/bN.svg
old mode 100644
new mode 100755
index 3ef486f..5cc2a5b
--- a/img/chesspieces/staunty/bN.svg
+++ b/img/chesspieces/staunty/bN.svg
@@ -1,23 +1,23 @@
-
-
+
+
diff --git a/img/chesspieces/staunty/bP.svg b/img/chesspieces/staunty/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/bQ.svg b/img/chesspieces/staunty/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/bR.svg b/img/chesspieces/staunty/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/wB.svg b/img/chesspieces/staunty/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/wK.svg b/img/chesspieces/staunty/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/wN.svg b/img/chesspieces/staunty/wN.svg
old mode 100644
new mode 100755
index 948cabc..f0f36a3
--- a/img/chesspieces/staunty/wN.svg
+++ b/img/chesspieces/staunty/wN.svg
@@ -1,23 +1,23 @@
-
-
+
+
diff --git a/img/chesspieces/staunty/wP.svg b/img/chesspieces/staunty/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/wQ.svg b/img/chesspieces/staunty/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/staunty/wR.svg b/img/chesspieces/staunty/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bB.svg b/img/chesspieces/tatiana/bB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bK.svg b/img/chesspieces/tatiana/bK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bN.svg b/img/chesspieces/tatiana/bN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bP.svg b/img/chesspieces/tatiana/bP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bQ.svg b/img/chesspieces/tatiana/bQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/bR.svg b/img/chesspieces/tatiana/bR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wB.svg b/img/chesspieces/tatiana/wB.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wK.svg b/img/chesspieces/tatiana/wK.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wN.svg b/img/chesspieces/tatiana/wN.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wP.svg b/img/chesspieces/tatiana/wP.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wQ.svg b/img/chesspieces/tatiana/wQ.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/tatiana/wR.svg b/img/chesspieces/tatiana/wR.svg
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bB.png b/img/chesspieces/wikipedia/bB.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bK.png b/img/chesspieces/wikipedia/bK.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bN.png b/img/chesspieces/wikipedia/bN.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bP.png b/img/chesspieces/wikipedia/bP.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bQ.png b/img/chesspieces/wikipedia/bQ.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/bR.png b/img/chesspieces/wikipedia/bR.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wB.png b/img/chesspieces/wikipedia/wB.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wK.png b/img/chesspieces/wikipedia/wK.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wN.png b/img/chesspieces/wikipedia/wN.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wP.png b/img/chesspieces/wikipedia/wP.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wQ.png b/img/chesspieces/wikipedia/wQ.png
old mode 100644
new mode 100755
diff --git a/img/chesspieces/wikipedia/wR.png b/img/chesspieces/wikipedia/wR.png
old mode 100644
new mode 100755
diff --git a/img/github-mark-white.svg b/img/github-mark-white.svg
old mode 100644
new mode 100755
diff --git a/img/github-mark.svg b/img/github-mark.svg
old mode 100644
new mode 100755
diff --git a/index.html b/index.html
old mode 100644
new mode 100755
diff --git a/screenshots/screenshot.png b/screenshots/screenshot.png
old mode 100644
new mode 100755
diff --git a/screenshots/screenshot2.png b/screenshots/screenshot2.png
old mode 100644
new mode 100755
diff --git a/screenshots/screenshot3.png b/screenshots/screenshot3.png
old mode 100644
new mode 100755