Monday, June 13, 2022

Play Like a World Champion series Paperbacks

I have created a series of books based on games from World Championship matches. The idea is the reader plays through the games and guesses the next move. This is similar to How Good is Your Chess? type books or Solitaire Chess . If you guess correctly you score and you get a rough rating estimate when a game is completed. To make it more interesting, it is multiple choice. You choose between up to 4 choices.

The eBook versions are fairly straight forward. You see a diagram with the choices. You cannot see the answer until you go to the next page on your device.

With paperbacks it is a little more complicated. You need to cover up the current page with a sheet of paper or card and move it down one line at a time. When the choices are displayed, do not move to the next line until you have chosen the move.

To make this easier, there is only one column on each page. The instructions are in each book.

Monday, August 2, 2021

How to Play Better Checkers

This book is for anyone interested in checkers (or draughts), from beginner to intermediate players. It is written by a chess master and national senior chess champion.

You do not need to know how to play chess to read this. Many of the ideas are similar to those in chess, however they will be fully explained when they are introduced. Checkers is a simpler game than chess, however there is still much subtlety and a wide difference between skill levels. With a good approach a player can improve at checkers very quickly.

It covers the rules. Many social players do not know how to play according to the rules.  This is a shame because rules such as forced capture determine the tactics in the game.

It also covers basic strategy and tactics. Strategy includes strategy in the opening, middle game and endgame. A wide variety of tactical ideas are demonstrated, which you can use to outwit your opponents.

There are tips on how to look ahead moves and calculate variations. A method is presented that can be used to help select your moves.

There is also analysis of complex positions and a complete game. Studying complex positions can help bring your play up to expert level.

How to have fun with computer chess tournaments

The top computer chess programs (or engines) are much higher rated than the strongest humans. Top chess engines can play some very interesting games.

This book explains how to run a tournament between chess engines. It gives ideas on:


  • What engines can be used.
  • What software to use.
  • What time limits can be used.
  • How games can be adjudicated.
  • What other settings can be used.
  • And more...

A sample series of tournaments is described. Tournaments include qualifying tournaments, a semi-finals and a finals. Engines playing include some of the top engines in the world, including the neural network program Leela.


There is a collection of 36 annotated games from the Finals. They are annotated by Bill Jordan, a chess coach, Fide Master and national senior champion. Notes are written in the style of notes for games between humans. Games can be played through with or without a board and set. Players of any level can learn from them or they can be played through just for fun.


My other books on computer chess include How to Write a Chess Program, How to Write a Bitboard Chess Engine, The Joy of Chess Programming and Think Like a Computer.


Another book on computer chess games is Calculation versus Intuition : Stockfish versus Leela.

Other Books
You can view my author page billjordanchess on Amazon. Some of my other books include:

  • Chess Basics Made Easy.
  • Chess Concepts Made Easy.
  • Tactical Patterns Made Easy.
  • Opening Moves Made Easy.
  • Opening Strategy Made Easy.
  • Optimise your Chess Thinking.
  • Play Fast, Positionally and Accurately.
  • A series called Tactics Move by Move.
  • A series called Endgames Made Easy.
  • A series called Play Like a World Champion.

Advanced Chess Programming

Advanced Chess Programming presumes the reader has some knowledge of C or C++ programming and understanding of basics of how engines work. It is not just for those who have tinkered with chess programming, but anyone who is curious about this topic.

For readers without programming experience I suggest my book The Joy of Chess Programming.

This book designed for people who have experience or understanding of chess programming or have read one or more of my books:

  • How to Write a Chess Program
  • How to write a Bitboard Chess Engine
  • How to write a JavaScript Chess Engine

It presents programming ideas from my strongest chess engine Simplicity. It also mentions ideas from open source engines such as Crafty, TSCP and the very strong StockFish. Also mentioned are ideas from engines with no open source such as Fruit, Rybka and Houdini.

The author is a FIDE master and national senior chess champion in addition to being a chess programming enthusiast. He was also an IT trainer for 10 years, teaching programming languages such as C++ to adults.

Rate Your Chess Books 1-4

Playing through master games is a proven method of improving. One method is to take one side, usually the winning side, and try and guess the next move. With practice you will correctly predict more moves. Doing so helps develop chess fluency.

When I was a junior I played through many master games, in many cases guessing the moves. It helped me to become national Junior champion.

One suggested approach was not to take too long on the moves, say about 10 seconds or so. You could score correct guesses. If the move was totally unexpected, then it would be a good time to see if you could understand why the move was played. Every move should have a clear idea behind it. If you cannot see the idea, there is a learning opportunity there.

Some books contained similar exercises as well as some columns in magazines etc. The exercises here are a little different. Instead of having to look at all possible moves, you will be given between one and four choices. This is similar to a multiple choice exam. This makes the task easier than having to look at all moves and may mean you examine some moves you would not have normally considered.

How to Score

Chess rater consists of a collection of 20 old master chess games. You may simply play over the games for their own sake if you wish. To use this program to the fullest you will choose one of the games and play over them and take the role of the winning player. The winning side will always be playing up the board.

For a number of opening moves you will not need to guess the move. The number will vary from game to game and will generally be between 8 and 12 moves (for each side).

After these opening moves have been played, you will then try and predict your players moves. Your choice will be selected from a number of candidate moves. In a few cases you will only have one move to choose from. In this case you shall get the correct answer. In most cases you will be presented with the maximum number of options which is 4. In same cases there will be 2 or 3 options.

If you guess correctly you will score points which will range from 1 to 6. This depends on the approximate complexity and difficulty of the move. If you score incorrectly you will not score for that move. Regardless of whether you are correct or not the correct move will be played. You can either write down or otherwise keep track of your total score and see what category you reach.

RATING

The score for each game will always be out of 50. Scores may vary from game to game so to get a consistent rating average your score over 10 games.

These are based on the FIDE (The international chess federation) rating system developed by Professor Elo.

The rating of 2400+ is only an approximation of the strength needed to be an international master.

Play Like a World champion series

This similar series of books is based on the following World champions.
  • Steinitz
  • Lasker
  • Capablanca
  • Alekhine
  • Euwue
  • Botvinnik
  • Smyslov
  • Tal
  • Petrosian
  • Spassky
  • Fischer
  • Karpov
  • Kasparov
  • Anand
  • Kramnik
  • Carlsen

Each book features a different world champion. How many of their moves can you guess?

  • 91-100 2500+
  • 81-90 2400 - 2499
  • 71-80 2200 - 2399
  • 61-70 2000 - 2199
  • 51-60 1800 - 1999
  • 41-50 1600 - 1799
  • 31-40 1400 - 1599
  • 21-30 1200 - 1399
  • 11-20 1000 - 1199
  • 0 -10 below 1000

Note that the total score is out of 100, unlike in Rate Your Chess and Rate Your chess 2 in which the score is out of 50.

The challenge is to increase your rating with each game!

Some time before creating this series there were some issues with the way I created chess diagrams in my books. Look Inside the Book would frequently split the boards and create gaps between the ranks. One of my readers pointed out that the diagrams in one of my books did not display correctly on his phone.

The way I was creating diagrams was to use tables in html. One advantage was that this led to small book files. This made them quicker to upload and download.

Another advantage was the Amazon delivery fee was minimal. The delivery fee is subtracted from the author's royalty.

Because of the issues with tables I decided to change the way I created tables. I went to some trouble to convert all my diagrams to image files. OK I wrote a program to do it. Did you think I would convert tens of thousands of diagrams manually?

Part of one of the diagrams is on the above book cover.

Unfortunately this caused the delivery fee to blow out in books with many diagrams. In many cases the royalty went to zero. A good example was what happened with my Rate Your Chess series of 2 books. Diagram numbers could not be reduced as there needed to be a diagram for each position a move was to be guessed in.

My solution was to split the 2 books into 4 moves while improving and adding text. And that is why there are 4 books instead of 2.

The Art of Cheating in Chess

This is a not too serious look at the myriad forms of cheating in chess, including intentional and unintentional cheating and legal and illegal cheating.

It looks at some historical cheating incidents, including the story of the chess playing machine in the 1800s. It explains some the reasons why the chess clock was invented.

Included is cheating in various forms of chess including in OTB (over the board chess), correspondence chess, online chess, blitz, simuls etc.

It looks at cheating in world championship matches.

It includes issues such as passive smoking in chess events, computer cheating, the story of dunny gate and many other stories.

Calculation versus Intuition

The top computer chess programs (or engines) are much higher rated than the strongest humans. Top chess engines can play some very interesting games. This is a collection of about 40 annotated games from games between the very strong Stockfish and Leela chess engines. Games are from one of their matches in the Top Chess Engine Championship (TCEC). They are annotated by Bill Jordan, a chess coach, Fide Master and national senior champion. Notes are written in the style of notes for games between humans. Games can be played through with or without a board and set. Players of any level can learn from them or they can be played through just for fun.

There are only decisive games. Draws are not included.

To prevent games being repeated, openings are fixed. Each engine plays both white and black in each fixed opening position. Some openings are risky and dubious. In some cases both engines lost when playing one colour.

A wide variety of openings has been selected, including gambits and some leading to highly unbalanced positions.

Stockfish plays good solid chess, relying on a deep and fast search and good positional evaluation. Stockfish represents calculation.

Leela generally plays well strategically, especially for an engine. However it often does not mind sacrificing material for piece activity. Leela searches deeply with it’s Monte Carlo Tree Search, but does not search as many positions as StockFish. The contrast of styles makes for interesting chess. Leela represents intuition.

While Stockfish was the overall winner, Leela won it’s share of games.

Adventures in Correspondence Chess

This is a book about some of my experiences of playing correspondence (also called postal) chess. It was a time when chess by email was new and chess engines were not as strong as they are now. Playing correspondence chess can teach many things. The book includes some games I played when I was a junior, still new to chess.

CC Master Tim Runting wrote in the national correspondence chess magazine: Bill Jordan's winning of the 1995 Australian Championship with 12.5/13 in what was one of the strongest events ever has unfortunately gone unnoticed in the CC world. Although chess engines were around then, I won the event without using a computer. This book includes all my games from the championship.

How to Write a Javascript Engine

There are a number of reasons why you may be interested in how a chess program is written:

  • You are learning programming and interested in learning something different.
  • You are a programmer who is interesting in developing their programming experience.
  • You are a chess enthusiast and would like to improve your chess by learning how chess programs work.
  • You are interested in developing a chess program and playing against it.
  • You are interested in developing a chess program and having it play other engines.
  • You do need to be an expert programmer to understand this book. The code is written as simply as possible. The code is designed to be simple even for intermediate and even novice programmers.

If you are not a programmer, but am interested in chess, this book may be of interest.

The book includes annotation of the source code for a complete chess engine the author has developed as a teaching tool. The complete source code is available at GitHub. The program can be edited with any text editor and run on a web page. You can alter the code and see if you can make it stronger.

The program is a derivative of my program referred to in my earlier book How to Write a BitBoard Chess Engine.

The engine is strong enough to beat most social players.

Features of the engine include:

  • It can play a human or itself.
  • It has the ability to load positions.
  • It is reasonably fast.
  • It displays the best line of play for both sides.
  • Detects checkmate.
  • Detects draws by repetition, 50 move rule, stalemate or reduction of material.

Evaluation

The engine evaluates elements of a position including:

  • Material.
  • Piece position.
  • King safety.
  • Pawn structure.
  • Passed pawns etc

Search

The engine uses a standard alpha-beta minimax search including:
  • Cut offs.
  • Move ordering.
  • History moves,
  • Hash tables.
  • Extensions.
  • Reductions.
  • Capture search.
  • And much more…

My other books on computer chess include How to Write a Chess Program, The Joy of Chess Programming, How to Write a Bitboard chess Engine and Think Like a Computer.

How to Write a BitBoard Chess Engine

Introduction
There are a number of reasons why you may be interested in how a chess program is written:

  • You are learning programming and interested in learning something different.
  • You are a programmer who is interesting in developing their programming experience.
  • You are a chess enthusiast and would like to improve your chess by learning how chess programs work.
  • You are interested in developing a chess program and playing against it.
  • You are interested in developing a chess program and having it play other engines.

You do need to be an expert programmer to understand this book. The code is written as simply as possible. The code is designed to be simple even for intermediate and even novice programmers.

If you are not a programmer, but am interested in chess, this book may be of interest.

The book includes annotation of the source code for a complete chess engine the author has developed as a teaching tool. The complete source code is available at GitHub. The program can be compiled using a freely downloadable compiler. You can alter the code and see if you can make it stronger.

The program is a derivative of my program referred to in my earlier book How to Write a Chess Program, which did not use bitboards. The book explains how bitboards work and some of the many ways they can be useful in programming. The bitboard version runs considerably faster and is consequently stronger.

Alternatively you can simply download the exe file and run the program.

The engine is strong enough to beat most social players.

Features of the engine include:

  • The ability to load positions.
  • The ability to play in chess engine tournaments, with programs such as Arena.
  • Its very fast.
  • It displays the best line of play for both sides.
  • Detects checkmate.
  • Detects draws by repetition, 50 move rule, stalemate or reduction of material.

Evaluation

The engine evaluates elements of a position including:

  • Material.
  • Piece position.
  • King safety.
  • Pawn structure.
  • Passed pawns etc

Search

The engine uses a standard alpha-beta minimax search including:

  • Cut offs.
  • Move ordering.
  • History moves,
  • Hash tables.
  • Extensions.
  • Reductions.
  • Capture search.

And much more…

My other books on computer chess include How to Write a Chess Program, The Joy of Chess Programming and Think Like a Computer.

Tactics Move by Move Books 1-5

This is a series of 5 puzzle books. There are different levels of difficulty. Most puzzle books give a position and then a line of play as the answer. This is different in that you need to find each move of the answer, move by move. Note that Look Inside removes page breaks, the full Kindle version has page breaks before moves are shown.  

Why learn tactics?
The most important skill in chess is tactical skill. The stronger the player, the faster they can see tactics. There is a good correlation between how quickly a player sees tactics and their rating. There are several ways in which tactics help your Chess skill.
  • You can checkmate, win material, queen a pawn or draw a weaker position with tactics.
  • Seeing your opponent's tactics helps prevent them from happening.
  • You learn to recognise positions that are tactically weak.
  • You learn to recognise positions that are tactically strong.

I am an experienced Chess master and Chess coach. I have read many tactics books, and grew up on books like Fred Reinfeld's 1001 Checkmates and 1001 Winning Sacrifices. All the strong players I knew in those days had worked through quite a few tactical puzzles.

Move by Move
You are only expected to find one move at a time, just like in a real game. This is different from most puzzle books where you are given an entire line of play as the answer.

Order of Difficulty
Positions at the start of Book 1 are suitable for novices, while positions in Book 5 are challenging enough for strong club players.

Avoiding Blunders
A point has been made you may only have a few tactical opportunities per game. However, almost every move you have the chance of making a tactical blunder. Tactical skill is invaluable in checking whether a move is safe or not, before you play it!                  
How difficult should positions be?
Easy positions means you will get through more positions and become familiar with more themes. Difficult positions helps develop the ability to calculate variations in complicated positions. I prefer the first approach based on my coaching experience. It's the easier and more efficient approach.

Comments about notes
Here are explanations for some of the notes. Mating on the file or mates on the file, typically mean it will be mate soon after one or more useless blocking moves. The same applies to mating on the rank or diagonal.

A contact check is when a piece is one square away from the king. If the checking piece is defended a contact check is often strong. Queen contact checks tend to be especially strong.

A discovered check often wins material.

A double check forces the king to move.

Notes sometimes refer to tactical devices such as pins, skewers etc. There is more information about tactical ideas in my book Tactical Patterns Made Easy.

The notes are written are in a way to demonstrate how different types of moves fit together.

Enjoy the positions and have fun!

Other Books
You can view my author page billjordanchess on Amazon. Some of my other books include :
  • Chess Basics Made Easy.
  • Chess Concepts Made Easy.
  • Tactical Patterns Made Easy.
  • Opening Moves Made Easy.
  • Opening Strategy Made Easy.
  • How to Write a Chess Program and other books on computer chess.
  • Optimise your Chess Thinking.
  • Play Fast, Positionally and Accurately.
  • A series called Tactics Move by Move.
  • A series called Endgames Made Easy.
  • A series called Play Like a World Champion.
     

Play Fast, Positionally and Accurately

When I played in the World Junior, I met International Master David Strauss He was the second of US player Larry Christiansen, who came second in the event. David Strauss gave me this advice. Play fast, play positionally and analyse accurately. What did this mean?

Play Fast

This does not not mean to play so fast that you make silly mistakes. It means you play fast enough to avoid getting very short of time. Playing fast and soundly puts pressure on a slower moving opponent. Playing fast may mean you play more intuitively than otherwise. Play Positionally Playing positionally does not mean always playing timidly or cautiously. It means having a sound positional basis for your moves, regardless of whether the position is quiet or wild.

  • Keeping your king safe.
  • Placing your pieces on good squares.
  • Taking the pawn structure into account.
  • Making good exchanges.
  • Aiming for good endgames.
  • Analyse Accurately.

There are some good intuitive positional players who make errors because they don’t analyse (or calculate) enough when needed. Accurate calculation helps avoid tactical errors. Combining These Combining playing fast, playing positionally and analysing accurately together helps you bring out your best. This book includes 25 annotated games.

I have used some of my own games. This makes it a little different from most chess books.

It is unlikely that you have seen the games before (unless you were one of the players)! I know what I was thinking and feeling during the games. There is very little computer analysis, which can be overwhelming. The focus is more on why moves were played, not what was missed. There are good moves and not so good moves. Games may fluctuate. One has to play the move that creates the best chances.

Games

Games were played in State Championships over the last 3 years. Each championship was a ten player round robin. The time limit was 90 minutes for the game plus a 30 second increment per move. There is a wide variety of openings played and types of middlegame and endgame positions.

I believe you will find the games interesting and instructive.

Enjoy!

Tuesday, July 13, 2021

Bill Jordan Chess Facebook Page

I have created a new Facebook page to enable people interested in my chess books to connect with me and each other. The page is called Bill Jordan Chess and the page is at Bill Jordan Chess. It is early days yet and I am still learning about setting up a Facebook page.

Monday, November 4, 2019

Review of Endgames Made Easy.

Its great to get a review.

Carvalho Peter wrote In one pawn endgame problem there is an error . b6 would be replied with .....Ka6 and the only way to protect the pawn is Kc6 which results in stalemate. ....Kb8 by black is a blunder permitting Kb5 and the a5 pawn is lost losing. The correct winning technique is available in standard endgame book by Averbakh.

Unfortunately its not clear to me which position Peter is referring to.

This position would fit. However 1.b6 Ka6 would be met by 2.b7 Kxb7 3.Kb5 and wins as per other examples. If 2...Ka7 then 3.b8Q+ Kxb8 4.Kb6 wins.

Thanks Peter for bringing this up.

Readers are encouraged to engage with a review and I can respond on this blog.

Wednesday, August 14, 2019

My Favourite Chess Variants

What is a Chess Variant?

There are some quite interesting games played with a chessboard and pieces apart from chess. This is a not too serious look at these so-called chess variants.

Some of them can be played on the Internet Chess Servers. Here is an overview of some of them, including my favourites.

Some have very different rules than chess. Others have only a single rule change.

Why learn about Variants?

Playing a variant can be a light hearted form of entertainment after playing competitive chess. Some are easy to play, some can be highly complex.

Some variants have instructional value, especially for juniors. Some variants help teach the ability to see ahead and see around.

Types of Chess Variants

Some use all or some of the standard chess pieces. This book will mostly concentrate on those variants which use a standard chess board and do not need non-chess pieces.

There are many variants which use different types of boards. Some are not square. For example, they may be rectangular or Cross-shaped. A few are square though smaller than 8x8, while others are larger. This book will concentrate on variants you can play with a normal chessboard and set. In some cases an additional board or pieces are needed. You will not need to create new types of pieces or boards.

Most variants are two player games. Some are solitaire games, while others are multi-player.

Some variants require a lot of skill while others are much simpler than standard chess. Some variants have a chance element.

Overview of Rules

This is not an encyclopedia of the all the many chess variants. Many of the variants have variations in the rules. This book is not a reference of the rules. It is an overview of variants I have learned, mostly from word of mouth.

Included are:

  • Rules
  • Tips
  • and some sample games of some of the more interesting chess variants.

Knight and Four Pawns Puzzle

The White Knight moves to every square on the board, except those occupied or controlled by a Black pawn.

Nc2 Na3 Nb1

The Knight moves to b1.

Tricky King Pawn Openings

Understanding tricky openings can help you sometimes win quickly and avoid losing quickly. Sometimes its the other way round, either way they can be great fun.

The Open game (1.e4 e5) offers better chances for an early tactical skirmish than any other openings. Both players have made a first move that activates their pieces as much as possible. Its also likely both sides will castle quicker than after 1.d4.

This book is designed to give an overview of tricky openings. It is not meant to be an exhaustive analysis of every tricky opening. It is meant to make readers aware of some of the tricky openings that exist. You are encouraged to research openings in depth that you wish to play.

What Is A Tricky Opening?

Tricky openings vary in their soundness. Some offer equal chances, others are inferior against best play. Whether they are worth playing depends on the context. It depends on the strengths of the players, the time limit and the seriousness of the game. In unrated blitz games, it is worth playing any tricky opening that interests you. In games where rating points, tournament places etc are in stake, then whether to play a risky opening and which one may need to be made carefully.

Tricky openings can be introduced by either player. Some tricky openings can be met with even trickier responses.

Some players play the same opening over and over. This was more common in the pre-computer era. These days it sets you up to be met with well prepared opponents who have used databases and engines to study your tricky opening. If you vary your openings, you keep your opponent’s guessing. If you know you opening is someone who doesn’t bother preparing, then you may not need to.

What are some tricky openings?

Balanced, including symmetrical positions tend to lead to solid openings. Unbalancing the position, especially with gambits and sacrifices, tends to lead to tactical dynamic positions. Both sides castling kingside early is more likely to lead to a quiet game. Castling on opposite sides or one or both kings not castling at all, tends to lead to a more dynamic game. Open positions tend to more tactical than closed positions, though some closed positions can be quite tactical.

Why play tricky openings?

Tricky openings tend to lead to more interesting positions, at least in the early part of the game. You may play tricky openings just for fun. Playing tricky openings for fun can be especially good in social games or blitz games.

You may play tricky openings to practice your tactics and play in dynamic positions. They may help you understand the initiative better.

You may play tricky openings to increase your chances of winning. This is especially the case if your opponent knows less about the opening than you do!

You may want to be prepared if an opponent plays a tricky opening on you.

GM Nigel Short gave a lecture in Adelaide in 2016. His topic was the Evans gambit, which definitely falls in the category of tricky openings. He said to club players,
Don’t play something dull like the Berlin defence to the Lopez (1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6) which often leads to an early queen exchange. Play sexy chess.

Types of tricky openings

Tricky openings vary from lines where White is taking no risk at all, but play is tricky, to openings that take huge risk, like the crazy Halloween attack (1.e4 e5 2.Nf3 Nc6 3.Nc3 Nf6 4.Nxe5!?)

White and Black tricky openings

Either White or Black can initiate a tricky variation. Sometimes a tricky opening move can be countered with a tricky reply.

Inventing your own tricky openings

The more tricky opening moves you become familiar with, the easier it will be to stump your opponents with your own outrageous moves.

1.e4 e5 2.Nc3 Nf6 3.f4 d5 4.fxe5 Nxe4 5.d3

...Bb4

Offering a piece.

6.dxe4 Qh4+ 7.Ke2 Bxc3 8.bxc3

...Qg4+

Its equal. Don’t play 5...Bb4 if you don’t want a draw!

How I learned Chess

This is a memoir of some of the highlights of some of my chess experiences as a junior. I will take you on a journey from the time I learned the moves at the age of seven until I completed secondary school.

It is from an era before mobile phones, Internet, chess databases and chess engines. It was the days of black and white television and milk carts drawn by horses. It was when you could play correspondence chess without any concern an opponent may be getting assistance from a computer.

It happened in a time and place that formal chess coaching was almost non-existent. In those days people learned chess from books. It happened in a city with a library that was home to the world’s largest collection of chess books.

Its story of learning through books and magazines, through playing over master games, doing chess puzzles, playing blitz and correspondence chess, learning from one’s own mistakes and learning from others. For those on the path to improving their understanding of chess it may be possible to make a few insights.

It includes highlights of games from state Junior championships, national junior championships, club games, weekenders and other types of tournaments. Some games are rather unusual.

It includes games with various national champions, two world chess champions and a world correspondence chess champion.

My tournament experience began with the State Under 14 and includes the journey to the national junior title. Shortly after completed school I played overseas representing Australian in the first Asian Teams championship.

I was White against Steve Lewinsky, who was the State U16 champion.

1.d4 Nf6 2.c4 e6 3.Nc3 c5 4.d5 d6 5.Bg5 a6 6.e3 Be7 7.Bd3 exd5 8.cxd5 Nxd5 9.Nxd5 Bxg5 10.Nf3 Bg4 11.Qa4+ Bd7 12.Qe4+ Be7 13.Nxe7 Qxe7 14.Qxb7 Bc6 15.Qc8+ Qd8 16.Qg4 Qa5+ 17.Nd2 O-O 18.h4 Nd7 19.Qf5 g6 20.Qg5 Ne5 21.Be2 f5 22.h5 Rab8 23.hxg6 Nxg6 24.Qh6 Qc7 25.O-O-O

White has been attacking ferociously for some time.

...Bxg2? 26.Rh2

...Bd5

This pawn grab is not good. White could play Nc4 and Nxd6 or Rxd6 with a strong attack.

How to Write a Chess Program

There are a number of reasons why you may be interested in how a chess program is written:

  • You are learning programming and interested in learning something different.
  • You are a programmer who is interesting in developing their programming experience.
  • You are a chess enthusiast and would like to improve your chess by learning how chess programs work.
  • You are interested in developing a chess program and playing against it.
  • You are interested in developing a chess program and having it play other engines.

You do need to be an expert programmer to understand this book. The code is written as simply as possible. The code is designed to be simple even for intermediate and even novice programmers.

If you are not a programmer, but am interested in chess, this book may be of interest.

The book includes the source code for a complete chess engine. The program can be compiled using a freely downloadable compiler. You can alter the code and see if you can make it stronger.

The engine is strong enough to beat most social players.

Features of the engine include:

  • The ability to load positions.
  • The ability to play in chess engine tournaments, with programs such as Arena.
  • Its very fast.
  • It displays the best line of play for both sides.
  • Detects reality of opponent’s pieces.
  • Detects checkmate.
  • Detects draws by repetition, 50 move rule, statemate or reduction of material.

Evaluation

The engine evaluates elements of a position including:

  • Material.
  • Piece position.
  • King safety.
  • Pawn structure.
  • Passed pawns.

Search

The engine uses a standard alpha-beta minimax search including:

  • Cut offs.
  • Move ordering.
  • History moves,
  • Hash tables.
  • Extensions.
  • Reductions.
  • Capture search.

And much more…

*/
int knight_score[64] = 
{
	-30, -20, -10,  -8,  -8, -10, -20, -30,
	-16, -6,   -2,   0,   0,   -2, -6, -16,
	-8,   -2,   4,   6,   6,   4,   -2, -8,
	-5,   0,   6,   8,   8,   6,   0, -5,
	-5,   0,   6,   8,   8,   6,   0, -5,
	-10,   -2,   4,   6,   6,   4,   -2, -10,
	-20, -10,   -2,   0,   0,   -2, -10, -20,
	-150, -20, -10, -5, -5, -10, -20, -150
};
/*
The knight gets stronger as it approaches the centre. The knight tends to be very weak in a corner on the opponent’s side. It is likely to be trapped there.

The Joy of Chess Programming

This is a memoir of my experiences with creating my own chess engine. It begins with first experiences with computer chess from books, magazines, movies and dedicated chess computers.

I witnessed a player by the name of Grant Crocker, playing 1.e3 and forced ChessChallenger to reply with 1...f5 (the Dutch defence). He then quickly won with 2.Qh5+?! g6 2.Be2 ?! gxh5??? 3.Bxh5#.

It progresses to when I had enough knowledge to write an amateur engine and was able to compete in computer chess tournaments.

Eventually my engine was strong enough to reach about 2400 ELo strength. It is able to find Fischers ...Be6 in the famous Game of the Century in a fraction of a second.

It gives insights into how chess engines work and how they select a move.

There are numerous tips on how we human players can learn from how computers play.

There are a number of reasons why you may be interested in how a chess program is written.

If so, you may be interested in my book How to Write a Chess Program.

I have another book on computer chess called Think Like a Computer which includes a number of games with engines playing engines at a shallow depth. This illustrates how engines evaluate positions.

Think Like a Computer

Computer chess has had a large impact on chess in the last two decades. Players have access to databases containing millions of games , they can even look up games played by a potential opponent. The Internet allows players to play fast games against players all around the world. Games can be watched live as they are being played. I have written several books on computer chess.

Computer chess programs (or chess-engines) have become very strong. Not only can be used as practice, they can be used to analyse games or study openings. Books have been written on how a player can study with the assistance of a chess engine.

In the 1970s there was a popular chess book called Think Like a Grandmaster by Soviet GM Alexander Kotov. He later wrote Play Like a Grandmaster and Train Like a Grandmaster. He wrote from his own experience and other grandmasters he rubbed shoulders with. He wrote on tree of analysis, candidate moves, avoiding blunders, when not to analyse, positional ideas, endgames etc. He gave ordinary chess players an insight into the mind of a grandmaster. To some extent this book helped them to think like a grandmaster.

These days strong computer programs (called chess engines) are very strong indeed. The top engines currently have ELO ratings above 3500.They can often analyse faster and more reliably than strong grandmaster.

We have Think Like a Grandmaster so why not have Think Like a computer?

There are many things we can learn from the strengths and weaknesses of chess engines.

What can we learn from the way computers play?

The author has been writing his own hobby chess engines since the 1990s. This book is designed to impart knowledge gained from this experience to chess players of all levels.

Note that this book is not about using computers to practice with or study chess. Its about what chess-players can learn from how computers play chess. Its also for readers who may be curious to learn something about how computers play chess. You do not need to be computer programmer to learn from how computers play chess.

1.d4 Nf6 2.c4 g6 3.Nc3 d5 4.cxd5 Nxd5 5.e4 Nxc3 6.bxc3 Bg7 7.Nf3 c5 8.Be3 Qa5

9.Qd2

This is the main line, though StockFish prefers Bd2.

...O-O

StockFish likes this.

10.Bc4

This does not fit in with Nf3. The knight needs to be on e2. StockFish likes Rc1. One advantage is that allows Nc6 to be met by d5.

...Nc6

StockFish likes this.