Saturday, October 10, 2015

How to convert pgn chess games to video free


1. Download ActivePresenter
- http://atomisystems.com/activepresenter/free-edition/

2. Download Babaschess
- http://www.babaschess.net/download.asp

3. Open ActivePresenter
    - new capture
    - video

4. Open Babaschess
    - open pgn file
    - auto-play chess game

5. Press Ctrl + End to finish video capture

6. In ActivePresenter, export video as mp4, AVI, WMV and WebM

Sunday, March 3, 2013

Example of 4-Round Swiss Chess Tournament


Swiss System Chess Tournament Basic Rules

- players with the same score are ranked according to rating
- Top half is paired with the bottom half
- Same two players cannot play twice
- Color alternates in succeeding rounds
- Winners versus winners
- Losers versus losers
- Ties are broken with Swiss tie-breaking systems


Number of Rounds


The number of rounds in a Swiss Chess Tournament is predetermined beforehand. In most occassions, it depends on the rules of the organizer and number of players. As a sample (for illustration purposes only):
up to 20 players --> 5 rounds
20 to 40 players --> 7 rounds
40 to 80 players --> 9 rounds


Number of Games in Tournament


To determine the total number of games (ideally) in the tournament:

Number of Games = [ Number of Players/2 ] x Number of Rounds

Example:


Given:
Number of players = 8
Number of rounds = 4

Using the formula,
Number of Games = 8/2 x 4
Number of Games = 4 x 4
Number of Games = 16 games


Scoring Point System


Win = 1 point
Draw = 0.5 point
Loss = 0


Pairing Procedure

Round 1:

- Pairings drawn randomly
- Pairings according to Chess Rating
- Pairings based on last year's performance.
- Pairings generated by Computer Pairing Software

Round 2:

- Winners in Round 1 play against winners
- Losers in Round 1 play against losers

Subsequent Rounds pairing rules:

- No player faces the same opponent twice
- Players play with opponents with the same or almost the same score
- Players play an equal number of games with the White and Black pieces
- Players' color of pieces alternate in each round
- Same color 3 times in a row is not allowed


Tie-Breaking

- after the last round, players are ranked by total score points
- if there is a tie, it is broken using the Buchholz chess rating (sum of all their opponents' scores) or other chess tie-breaking methods in Swiss system tournaments such as Solkoff, Median (Harkness System), Modified Median, Cumulative, and so on.


---- PAIRING ----

Prepare Table of Players sorted by Rating (descending)


Rating   List of Players for Tournament (Masters & Grandmasters Championship)
2650     Players 1
2600     Players 5
2550     Players 2
2500     Players 6
2450     Players 3
2400     Players 7
2350     Players 4
2300     Players 8

Divide the list in two groups (or many groups)


Top Half: (Group I)
2650  Player 1
2550  Player 2
2450  Player 3
2350  Player 4

Bottom Half: (Group II)
2600  Player 5
2500  Player 6
2400  Player 7
2300  Player 8

Standard Swiss System Pairing

Round 1:


Player #1 versus Player #5, Player #1 wins
Player #2 versus Player #6, Player #2 wins
Player #3 versus Player #7, Player #3 wins
Player #4 versus Player #8, Player #4 wins

Winners in Round 1
Players 1
Players 2
Players 3
Players 4

Losers in Round 1
Players 5
Players 6
Players 7
Players 8


Round 2:


Winners vs. Winners
Player #1 plays Player #3, Player #1 wins
Player #2 plays Player #4, Player #2 wins

Losers vs. Losers
Player #5 plays Player #7, Player #5 wins
Player #6 plays Player #8, Player #6 wins

After two rounds, the score standings are:

Player #1: 2-0  (2 wins, no loss)
Player #2: 2-0
Player #3: 1-1  (1 win, 1 loss)
Player #4: 1-1
Player #5: 1-1
Player #6: 1-1
Player #7: 0-2  (no win, 2 loss)
Player #8: 0-2


Round 3:


Winners against Winners
Player #1 against Player #6, Player#1 wins
Player #2 against Player #5, Player#2 wins

Losers against Losers
Player #3 against Player #8, Player#3 wins
Player #4 against Player #7, Player#4 wins

Score sheet after three rounds:

Player #1: 3-0  (3 wins, no loss)
Player #2: 3-0
Player #3: 2-1  (2 wins, 1 loss)
Player #4: 2-1
Player #5: 1-2  (1 win, 2 losses)
Player #6: 1-2
Player #7: 0-3  (no win, 3 losses)
Player #8: 0-3


Round 4:


Winners versus Winners
Player #1 vs. Player #2, Player#1 wins
Player #3 vs. Player #4, Player#3 wins

Losers versus Losers
Player #5 vs. Player #6, Player#5 wins
Player #7 vs. Player #8, Player#7 wins


If the number of rounds established is 4, then Round 4 is the Last Round. A final scoresheet and final crosstable is prepared to declare the clear winner. If there is a tie, and there is no split in the prize fund, then the tie will be broken through Swiss system tie-breaking methods in chess.

On the final round, the final scores are:

Player #1: 4-0  (4 wins, no loss) --> Winner (Champion)
Player #2: 3-1
Player #3: 3-1  (3 wins, 1 loss)
Player #4: 2-2
Player #5: 2-2  (2 wins, 2 losses)
Player #6: 1-3
Player #7: 1-3  (1 win, 3 losses)
Player #8: 0-4

In this example of a 4-round Swiss Chess Tournament,
the winner or champion is Player #1.


---- Example of Chessmaster software Swiss Tourney ----

Example of a 4-round Swiss Chess Tournament Results (Chessmaster 9000):


Name                Wins    Draws   Losses  Games   Score   OPS   Bye
Aidan                  4       0       0       4     4.0    1454   
Niko                   3       0       1       4     3.0     927   
Ben                    2       0       2       4     2.0    1747   
Petra                  2       0       2       4     2.0    1284   
Tex                    2       0       2       4     2.0     898   
Manny                  1       0       3       4     1.0     879   
Chessmaster            1       0       3       4     1.0     630   
Alekhine               1       0       3       4     1.0     490   


Tournament Crosstable results


Name        1       2       3       4       Total
1.Aidan        W3:1    B8:1    B7:1    W4:1    4.0/4
2.Niko        W6:1    B3:0    W5:1    W8:1    3.0/4
3.Ben        B1:0    W2:1    B8:0    W7:1    2.0/4
4.Petra        W8:1    B5:0    W6:1    B1:0    2.0/4
5.Tex        B7:0    W4:1    B2:0    W6:1    2.0/4
6.Manny        B2:0    W7:1    B4:0    B5:0    1.0/4
7.Chessmaster    W5:1    B6:0    W1:0    B3:0    1.0/4
8.Alekhine    B4:0    W1:0    W3:1    B2:0    1.0/4


Games


=== Round 1 ===
    Chessmaster vs      Tex -- Black is Checkmated - Game 1
          Petra vs Alekhine -- Black is Checkmated - Game 2
          Aidan vs      Ben -- Black is Checkmated - Game 3
           Niko vs    Manny -- Black is Checkmated - Game 4

=== Round 2 ===
       Alekhine vs       Aidan -- White is Checkmated - Game 5
          Manny vs Chessmaster -- Black is Checkmated - Game 6
            Tex vs       Petra -- Black is Checkmated - Game 7
            Ben vs        Niko -- Black is Checkmated - Game 8

=== Round 3 ===
    Chessmaster vs       Aidan -- White is Checkmated - Game 9
          Petra vs       Manny -- Black is Checkmated - Game 10
           Niko vs         Tex -- Black is Checkmated - Game 11
       Alekhine vs         Ben -- Black is Checkmated - Game 12

=== Round 4 ===
            Ben vs Chessmaster -- Black is Checkmated - Game 13
            Tex vs       Manny -- Black is Checkmated - Game 14
           Niko vs    Alekhine -- Black is Checkmated - Game 15
          Aidan vs       Petra -- Black is Checkmated - Game 16

Sunday, December 16, 2012

How to program a chess engine in C++ language compatible with Xboard/Winboard: Chess Board Representation


Chess Board Representation is a very basic necessity in chess engine programming because it is the way to show the movements of the pieces and to visualize the current position of each player in the game. Some people prefer the use of arrays in C++ but this method below uses no arrays. It is just plain and simple way of representing the chess board. The lowercase letters r, n, b, k, q, and o represent Black's pieces and the uppercase letters R, N, B, K, Q, and P represent White's pieces. The numbers 1, 2, 3, 4, 5, 6, 7, 8 on the left represent the ranks while the letters a, b, c, d, e, f, g, h on the bottom represent the files.

Any suggestions and better ideas about how to represent the chess board for the chess engine program would be much more appreciated for the benefit of those who want to learn how to program their own chess engines. Also, a little sharing of your code would be a big bonus from you (I know you have better ideas, ways and methods in C++ programming to accomplish the same task). Thanks in advance :)

Source code:

/*
PROGRAM 7: Chess - board representation
AUTHOR: eternaltreasures
DATE: 2010 September 22
*/


#include <iostream>
#include <string>
using namespace std;

#define newline '\n'

//border represents the horizontal border lines between the ranks or rows of the chessboard
#define border "   +---+---+---+---+---+---+---+---+"

//sp represents the vertical spacer lines between the squares
#define sp " | "

/*
r1 to r8 represents the ranks or rows of the chess board, letters a to h represents the
files. The combination of these letters and numbers will be used in the coordinate
system of representing moves in chess.
*/
#define r8 "8 "
#define r7 "7 "
#define r6 "6 "
#define r5 "5 "
#define r4 "4 "
#define r3 "3 "
#define r2 "2 "
#define r1 "1 "
#define boardfiles "     a   b   c   d   e   f   g   h"

//ranks 8 and 7 are Black's initial position and ranks 1 and 2 for White.
char a8='r', b8='n', c8='b', d8='q', e8='k', f8='b', g8='n', h8='r';
char a7='o', b7='o', c7='o', d7='o', e7='o', f7='o', g7='o', h7='o';
char a6=' ', b6=' ', c6=' ', d6=' ', e6=' ', f6=' ', g6=' ', h6=' ';
char a5=' ', b5=' ', c5=' ', d5=' ', e5=' ', f5=' ', g5=' ', h5=' ';
char a4=' ', b4=' ', c4=' ', d4=' ', e4=' ', f4=' ', g4=' ', h4=' ';
char a3=' ', b3=' ', c3=' ', d3=' ', e3=' ', f3=' ', g3=' ', h3=' ';
char a2='P', b2='P', c2='P', d2='P', e2='P', f2='P', g2='P', h2='P';
char a1='R', b1='N', c1='B', d1='Q', e1='K', f1='B', g1='N', h1='R';


void introduction ()
{
cout << "   Chess Engine Program 1.0";
cout << newline;
cout << "   by eternaltreasures";
cout << newline;
cout << "   September 2010";
cout << newline;
cout << newline;
}

//function called by main () to display the chess board.
void displayboard ()
{

cout << border;
cout << newline;
cout <<r8<<sp <<a8<<sp <<b8<<sp <<c8<<sp <<d8<<sp <<e8<<sp <<f8<<sp <<g8<<sp <<h8<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r7<<sp  <<a7<<sp <<b7<<sp <<c7<<sp <<d7<<sp <<e7<<sp <<f7<<sp <<g7<<sp <<h7<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r6<<sp  <<a6<<sp <<b6<<sp <<c6<<sp <<d6<<sp <<e6<<sp <<f6<<sp <<g6<<sp <<h6<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r5<<sp  <<a5<<sp <<b5<<sp <<c5<<sp <<d5<<sp <<e5<<sp <<f5<<sp <<g5<<sp <<h5<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r4<<sp  <<a4<<sp <<b4<<sp <<c4<<sp <<d4<<sp <<e4<<sp <<f4<<sp <<g4<<sp <<h4<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r3<<sp  <<a3<<sp <<b3<<sp <<c3<<sp <<d3<<sp <<e3<<sp <<f3<<sp <<g3<<sp <<h3<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r2<<sp  <<a2<<sp <<b2<<sp <<c2<<sp <<d2<<sp <<e2<<sp <<f2<<sp <<g2<<sp <<h2<<sp;

cout << newline;
cout <<border;
cout << newline;
cout <<r1<<sp  <<a1<<sp <<b1<<sp <<c1<<sp <<d1<<sp <<e1<<sp <<f1<<sp <<g1<<sp <<h1<<sp;
cout << newline;
cout << border;
cout << newline;
cout << newline;
cout << boardfiles;
cout << newline;
cout << newline;
}

int main ()
{
introduction ();
displayboard ();

//Move entry - it asks the player to enter the move in coordinate system of chess move notations.
string entermove = "e2e4";
cout << newline;
cout << "Enter your move:";
cin >> entermove;
cout << entermove;
}

Saturday, December 15, 2012

How to setup the TCP/IP in Chessmaster 9000 CM LIVE:


This procedure for the TCP/IP setup in Chessmaster Live or CM LIVE in Chessmaster was tested using Chessmaster 9000 in Windows XP with 2 computers in a home network connected by a common router. The procedure for the setup of TCP/IP should be similar in older versions of Chessmaster as well as newer versions such as the Chessmaster 10th edition and the Chessmaster XI or the Grandmaster edition.

How to setup the TCP/IP in Chessmaster 9000 CM LIVE:

Hosting computer:

-----------------------
1. Start Chessmaster 9000
2. CM LIVE
3. TCP/IP
4. In the Create Session Box -> Game Name -- chessmaster
5. Click Host

Joining computer:

----------------------
1. Start Chessmaster 9000
2. CM LIVE
3. TCP/IP
4. In the Create Session Box -> Game Name -- chessmaster
5. In the Join Session Box -> Host IP Address or DNS Name -> 192.168.2.10 (Start -> Run -> cmd -> ipconfig (to obtain ip address)
6. Click Join

Note: chessmaster is a sample of Game Name and 192.168.2.10 is a sample ip address.

Challenge or Starting a chess game:

--------------------------------------------------
1. Windows -> Online Information
2. Right click the Name of the player and click Challenge
3. Send Challenge
4. Other player will Accept the Challenge
5. Play the game

CHESS Puzzles, Problems with solutions - mate in 3 by Two Bishops & King

CHESS PUZZLE:

White to move and mate in 3 moves.

This chess puzzle is an endgame problem of mating the opponent King using two Bishops with the help of the friendly King.


SOLUTION:

1. Ba6.
1... Kb8.
2. Bh2+.
2... Ka8.
3. Bb7 checkmate.

CHESS Puzzles, Problems with solutions - mate in 3 by Bishop & Knight

CHESS PUZZLE:

White to move and mate in 3 moves.

This chess puzzle is an endgame problem of mating the opponent King using only the Bishop and Knight with the help of the friendly King.


SOLUTION:

1. Ba6.
1... Ka8.
2. Bb7+.
2... Kb8.
3. Nc6 mate.

CHESS Puzzles, Problems with solutions - mate in 3

CHESS PUZZLE:

White to move and mate in 3 moves.
 
In this Chess puzzle, White to move and mates Black in 3 moves. The three pawns in the 7th rank are ready to be promoted. Note that this position is symmetrical. No matter which pawn Black captures, the solution to this chess problem of promoting pieces are the same, i.e. Bishop and then Rook.


SOLUTION:


1. Bd8=B.
1. Kxc6.
4. Rb8=R.
5. Kd6.
6. Rb6 checkmate.