	/* Add a collection of puzzles */

// Custom functions

/* This is the place where you add quiz where the user have to find the correct next move on the board after some moves has been made at the start of the game*/
function addCustomQuiz_sequence()
{
// Syntax : addFindNextMoveFromSequence(moves,correctMove,difficulty, description,movesToExplain the solution)
// The last argument(moves to explain solution) is only used to show an extended sequence of moves in order to emphasize the solution

addFindNextMoveFromSequence('e4,e5,Nf3,d6,Nc3,Bg4,Bc4,a6,Nxe5,Bxd1,Bxf7,Ke7','Nd5#',30,'Mate!','');
addFindNextMoveFromSequence('e4,f5,exf5,Nc6,Qh5+,g6,fxg6,Nf6','g7+',50,'White wins a rook','g7+,Nxh5,gxh8=Q');
addFindNextMoveFromSequence('e4,c5,d4,cxd4,c3,dxc3,Nxc3,e5,Bc4,Nc6,Qb3,Nh6','Bxh6',30,'Removing the defender of f7','Bxh6,gxh6,Bxf7+');
addFindNextMoveFromSequence('d4,Nf6,c4,c5,d5,b5,cxb5,a6,Nc3,axb5,e4,b4,Nb5,Nxe4','Qe2',50,'Attacking the Knight and creating threat Nd6#.');
addFindNextMoveFromSequence('e4,e5,Nf3,f5,exf5,Kf7,Nxe5+,Kf6,d4,Kxf5,Qg4+,Kf6','Bg5#',50,'Mate!');
addFindNextMoveFromSequence('e4,e5,Qh5,Ke7','Qxe5#',10,'Checkmates the black king');
addFindNextMoveFromSequence('d4,d6,c3,Nf6,Bg5,Bg4,d5,e6','Bxf6',50,'The bishop on g4 is lost after Qa4+','Bxf6,Qxf6,Qa4+,Nd7,Qxg4');
addFindNextMoveFromSequence('e4,e5,Nf3,Ke7,d4,f5','Bg5+',50,'Black will loose a piece','Bg5+,Nf6,dxe5');
addFindNextMoveFromSequence('d4,Nf6,g3,b6,Bg2,Bb7','Bxb7',10,'Captures blacks undefended bishop and will also take the black rook','Bxb7,Nc6,Bxa8,Qxa8');
addFindNextMoveFromSequence('e4,e5,Nf3,a6,Nxe5,h6,Bc4,Nc6','Nxf7',10,'Forking queen and rook','Nxf7,Qh4,Nxh8');

}


function addCustomQuiz()
{
// Custom puzzles	

// Syntax:
// addFindTheMoveQuiz(white_pieces,black_pieces,correct_move,description_of_move,difficulty,additional moves to describe the solution)
// white pieces = comma separated list of pieces and their positions(example Kh1,Qh5,Nh6,g2,h2)
// black pieces = comma separated list of pieces and their positions(example Kd8,Rc8,Qc7,d7,e7)
// Solution: The correct solution, example: Nf7+ 
// Description of solution, example: Pinning the bishop
// Additional moves. A commaseparated list of additional moves to explain the solution

addFindTheMoveQuiz('Kh1,Qh5,Nh6,g2,h2','Kd8,Rc8,Qc7,d7,e7','Nf7+','Mate will follow after (1 .. Ke8 2. Nd6+ Kf8 3. Qf7#)',30,'Ke8,Nd6+,Kf8,Qf7#');
addFindTheMoveQuiz('Kg1,Nc4,Ne6','Ke8,Nd7,Ne7','Nd6#','Mate',10);
addFindTheMoveQuiz('Kg1,Rd1,Ba2,Qa5,Nf4,a3,b2,f2,g2,h2','Kh8,Ra8,Qe8,Bf8,b7,c5,d7,g7,h7','Qxa8','Mate will follow if black recaptures(1 .. Qxa8 2. Ng6+ hxg6 3. Rd3) and the rook will get to h3',40,'Qxa8,Ng6+,hxg6,Rd3');	
addFindTheMoveQuiz('Rg1,a2,b3,c2,Kb1,Bb2','a7,b6,c5,Rf8,f7,f6,h7,Kh8,Qe8','Bxf6#','Mate!',20);
addFindTheMoveQuiz('Ba2,a3,b2,f2,g2,h2,Rf1,Kg1,Ng5','Ra8,c6,d7,e7,Rd8,Ke8,Bf8,g6,h5','Bf7#','Mate',20);
addFindTheMoveQuiz('h6,g6,Kh5,Ne7,Bb1','Kh8,a7,b6,Ra8','g7#','Mate!',10);
addFindTheMoveQuiz('a6,Qf3,Kg1,f2,g2,h3','a7,b6,Kc8,Rd8,Qd7,c7,g7,h6','Qb7#','Mate!',8);		
addFindTheMoveQuiz('Ba2,Qb3,g2,h2,Ng5,Kg1','Qa8,Rc8,g7,h7,Kh8','Qg8+','A queen sacrifise. The rook is forced to take the queen. Nf7# will follow',30,'Rxg8,Nf7#');
addFindTheMoveQuiz('a4,Kb4,Bd4,Bg2','b5,Ka6','axb5#','Mate!',15);
addFindTheMoveQuiz('Rc3,Kg6','Bf8,Kg8','Rc8','The black bishop is pinned. Black is forced to move his King to h8. Mate will come in next move',10)
addFindTheMoveQuiz('Nf4,Kf3,Rg2','Kh8,Re5','Ng6+','Forking King and Rook',10);
addFindTheMoveQuiz('Bb2,c3,a2,Ka1,Nb3','Qd5,Kh8,h7,g6,f7','c4+','The black queen is lost. The bishop is checking the king and the pawn is attacking the queen',10,'Kg8,cxd5');
addFindTheMoveQuiz('Bd3,Qd1,f2,g2,h2,Kg1,Re1','Qd4,Nf6,Rc8,f7,g7,h7,Kg8,a5,b6,c7','Bxh7+','The black queen is lost',40,'Kxh7,Qxd4');
addFindTheMoveQuiz('Qd1,a2,b2,c3,Kb1','Ra8,Kg8,a7,g7,h7,Ng6','Qd5+','Forking King and Rook',20);
addFindTheMoveQuiz('Nc6,Bb2,Kh1,g2,h2,f4,a2,b3,Rf1,Qc2','a7,f7,g6,h7,Bb7,Bb8,Rf8,Kg8,Qc7,d7','Ne7#','Mate!',30);
addFindTheMoveQuiz('Ba2,Bc1,Kf1,f3,g2,h2','Kh8,h7,a7,b6,Qd8','Bb2+','One move from mate(1. ... Qd4 2. Bxd4# )',15,'Qd4,Bxd4');
addFindTheMoveQuiz('Kb1,a3,b2,c2,Bc3,Ra8','f7,g6,Kh7,Qe6,Re7,a7,b6','Rh8#','Mate!',10);
addFindTheMoveQuiz('Ng6,Ra8,Ke1,f5','Kh7,g7,f6,a7,b6,Qc5','Rh8#','Mate!',10);
addFindTheMoveQuiz('Kf4,Qg1','Kh5','Qg5#','Mate!',8);
addFindTheMoveQuiz('Qg3,Bb2,g2,h2,f3,Kg1,Rf1','f7,g7,h7,Kh8,Rf8,Ra8,a7,b6,Qc7','Qxg7#','Mate!',15);		
addFindTheMoveQuiz('Ba2,Kg1,g2,h2,Ra3','g7,g6,Kh8,Rb7,a7','Rh3#','Mate!',10);
addFindTheMoveQuiz('Kf1,Bg3,h2','Kg7,Rc3','Be5+','Forking king and rook',10,'Kf7,Bxc3');
addFindTheMoveQuiz('Ra5,Kg1,f2,g3,Bd2,Rf1,a2,b3','Kg8,f7,h7,Qg4,Rb8,e6','Rg5+','Forking King and Queen',10);
addFindTheMoveQuiz('Kg1,f3,g2,h2,Ne5,Rc1,Bg5','Ke8,Qb2,Ra2,g6,h4','Rc8#','Mate!',10);
addFindTheMoveQuiz('d5,e5,Re1,f2,g2,h3,Kg1','Qd7,Kf7,g5,h4','e6+','Forking King and Queen',10);
addFindTheMoveQuiz('Bb2,Ng4,e4,f3,Kg1,g2,h2,Re1','f7,g6,h7,Rf8,Kg8,Qe8','Nh6#','Mate!',10);
addFindTheMoveQuiz('Kg1,g2,h2,f3,Nh5,Qe4','Kg8,Rb8,f7,g6,h7,Qd7','Nf6+','Forking King and Queen',10);	
addFindTheMoveQuiz('Qd2,Rd1,a2,b2,c2,kb1,Bc3','f7,g6,h7,Kg8,Rd8,Qc8','Qxd8+','One move from mate',10,'Qxd8,Rxd8#');
addFindTheMoveQuiz('Kg1,f2,g2,h2,Re1','Bd5,g7,f7,h7,Kg8','Re8#','Mate!',10);
addFindTheMoveQuiz('Ke1,Rb1,e2,Bd3,f2','Bc8,Nc7,Kh8,f7,g7,h7','Rb8','Pinning the bishop',10);		
		
}

//selectQuiz_mixture();	// Default type of quiz to start with - i.e. a mixture of find color of squares, squares on same diagonals or 

selectQuiz_squares();

