Knowing the rules and basic strategies is only the beginning - there is so much to learn in chess that you can never learn it all in a lifetime! To improve you need to do three things:. While there is no one agreed-upon best move in chess, it's important to try to control the center right away. This usually results in most players playing one of their central pawns in front of king or queen forward two squares with either 1.

Some other players prefer 1. Most other moves are not as good. Bobby Fischer believed that moving the king-pawn 1. Pawns cannot move backwards. However, when a pawn gets to the other side of the board you must promote it to another piece such as a queen. Then it moves just like that piece, and can move backwards. You can only move one chess piece at a time when it is your turn to move - with one exception!

When you castle, you move both the king and the rook in one move. The king is the most important chess piece. If you lose the king, you lose the game.

But the queen is the most powerful chess piece. The origins of chess are not exactly clear, though most believe it evolved from earlier chess-like games played in India almost two thousand years ago. The game of chess we know today has been around since the 15th century where it became popular in Europe. Notation was invented so that we could analyze chess games after playing them.

Thanks to it, we can register the whole game in writing and reproduce it as many times as we want. We must only write down our moves and our opponent's moves correctly. Each square has a coordinate and each piece is represented by an initial N for knight, B for bishop, Q for queen, R for rook, and K for king. Chess is a game played between two opponents on opposite sides of a board containing 64 squares of alternating colors.

Each player has 16 pieces: 1 king, 1 queen, 2 rooks, 2 bishops, 2 knights, and 8 pawns. The goal of the game is to checkmate the other king. Checkmate happens when the king is in a position to be captured in check and cannot escape from capture. Ready to start playing chess? Sign up for free at Chess.

Updated: Apr 15, , PM. How to Setup the Chessboard At the beginning of the game the chessboard is laid out so that each player has the white or light color square in the bottom right-hand side. How the Chess Pieces Move Each of the 6 different kinds of pieces moves differently. Great Moments in Modern Chess. In this illustration it is white's turn. All spaces around the king are being attacked, but the king is not in check, therefore it cannot move.

The only other white piece, the pawn, is blocked by the king. Because movement is impossible, the game is a stalemate. If white had another piece somewhere on the board that was not blocked, it would have to move.

The game would continue. Chess is an incredibly complex strategic game, and it is impossible to go into all of the possible tactics one could use to win. However, I wanted to leave the new player with a few hints that will hopefully aid in victory. Piece Value: Obviously you want to protect your pieces from capture, but it helps to know which pieces are the strongest so you can decide who to save if you must choose between two. Pawns become more valuable as they near promotion.

Pawn Promotion: Although a pawn can be promoted to a variety of pieces, the strongest choice is almost always to promote to queen. Board Control: When building defenses, remember to look at the board and gauge how strong you are in certain areas of the board. Try an keep power distributed fairly evenly, and bring pieces over to add strength if you see an attack coming. When attacking, it's a bad idea to let any of your pieces become cut off from your main force. I find it helpful to have a support piece in mind when making an attack.

Using pieces in tandem almost always yields a better result than using one piece alone. So now you know the basics. Go get a board an play! No one around? Read more. Rules of the Hunt. The Rules Of Seduction. The Rules of Silence. The Rules of Attraction. The Rules of Engagement. The Rules of Seduction. Rules of The Hunt.

Rules of the trade. Rules of the Game. The Rules of Magic. Recommend Documents. Your name. Close Send. Get the input as an opponent move from the user P: player. Generate a current board configuration based on the opponents P last move. Set this current state as a root node for search tree.

Generate all possible moves for C C: computer as a response to this input. For each of these moves, generate all possible user P responses. As we now have the search tree of depth 2, apply Minimax search algo- rithm with Alpha-Beta Pruning to choose the best move for computer C. Output the computers move on the screen. Check for situations like check, checkmate, draw etc. Repeat 1 to 8 until the game ends. For mak- ing the intelligent we need two other things as well, first legal moves creation and a random move selection, second move selection after evaluation of all generated moves intelligently.

The best way to discriminate between the two is to look at their consequences i. And to make sure that we make as few mistakes as possible, we will assume that the opponent is just as good as we are. This is the basic principle underlying the minimax search algorithm, which is at the root of all chess programs.

This number grows impossibly fast, so a considerable amount of work has been done to develop algorithms that minimize the effort expended on search for a given depth.

Iterative-deepening Alphabeta, NegaScout and MTD f are among the most successful of these algorithms, we will discuses with more detail later in this document. Suppose that your program searches to a depth of 8-ply, and that it discovers to its horror that the opponent will capture its queen at ply 6.

It turns out that finding a position where a program can reason correctly about the relative strength of the forces in presence is not a trivial task at all, and that searching every line of play to the same depth is tantamount to suicide.

Numerous techniques have been developed to defeat the horizon effect. To give the intelligence to computer chess game which will form and make it able to think, take decision, do an optimal movement and compete against its opponents human automatically as real, in other words to make the chess game intelligent which will able to do optimal moves to gain the most profit and give the most damage to its opponent human ,for doing this task we need to implement Minimax with the Alpha Beta pruning algorithm which uses evaluation function to generate optimal moves and make the chess intelligent the relate to this issues discussed in this section.

Nodes representing your moves are generally drawn as squares or possibly upward pointing triangles : These are also called MAX nodes. The goal at a MIN node is to minimize the value of the subtree rooted at that node. We maximizes Whites score, perform a depth-first search and evaluate the leaf nodes, Choose child node with highest value if it is White to move, Choose child node with lowest value if it is Black to move. This evaluation takes the form of a number: a positive number indicates that Max is leading, a negative number, that Min is ahead, and a zero, that nobody has acquired an advantage.

The trouble with Minimax is that there is an exponential number of possible paths which must be examined. The simplest approach we would follow is searching to a depth of 2-ply, one move per player. MiniMax Algorithm 4. The Alpha-Beta Pruning algorithm is a significant enhancement to the mini- max search algorithm that eliminates the need to search large portions of the game tree. If one already has found a quite good move and search for alterna- tives, one refutation is enough to avoid it.

No need to look for even stronger refutations. The algorithm maintains two values, alpha and beta. They rep- resent the minimum score that the maximizing player is assured of and the maximum score that the minimizing player is assured of respectively.

Alpha-beta pruning gets its name from two bounds that are passed along during the calculation, which restrict the set of possible solutions based on the portion of the search tree that has already been seen.

To visualize this, we can use a number line. At any point in time, alpha and beta are lower and upper bounds on the set of possible solution values, like so: As the problem progresses, we can assume restrictions about the range of possible solutions based on min nodes which may place an upper bound and max nodes which may place a lower bound.

As we move through the search tree, these bounds typically get closer and closer together: This convergence is not a problem as long as there is some overlap in the ranges of alpha and beta. In other words, we stop generating its children and move back to its parent node. For the value of this node, we should pass to the parent the value we changed which exceeded the other bound.

Next section will explain development of chess game. The chessboard is an 8 by 8 grid. The initial configuration of the pieces is as follows: Figure Chess Board with pieces We proposed a design in which each type of chess pieces is represented by a separate class. We planned to implement 9 different classes for that purpose as follows: king, queen, knight, bishop, rook, pawn, Interface and Algorithm. What is the valid moves for the king? How it wakes the move? This class explain all this issues.

What is the valid moves for the queen? There are still other ways games can end, especially in tournament play, but these given are the most common for casual play. The white king below is shown before castling, and after. You can also castle queenside. Your king is not in check. You are not castling through check. It rarely occurs, but you still need to be aware of it. This is what the en passant rule prevents. Below is what the board looks like after white captures en passant.

One last reminder, this is a limited time offer. In other words, you can't wait for another turn to capture a pawn en passant -- you either do it right after the enemy pawn has moved, or you can't do it at all.

Because of this, an advantage of a pawn may not seem like much in the middlegame, but at the end of a game, it can mean the difference between a win and a draw. After the pawn is promoted to a queen, the position looks like the one on the right. Black has to move his king, allowing white to take the black queen and making for an easy win.

Games are written in algebraic notation.