Print

Selecting moves and variations

There are many issues that surface when writing interactive chess books. We have already seen that it's easy to convert a whole game to iBook format and there are also simple methods available for converting the current move, the current variation or a whole variation complex. The real challenge comes when you want a finer control over the display of moves and commentary, especially for games with many variations. When you are basing your writing on games in the iBook database, there are three ways to select a move sequence from a game. These methods even work for deeply nested variations. The image below shows a game fraction and we are interested in commenting on one of its variations (highlighted in yellow), which actually contains moves from the mainline a first level variation and a second level variation.
Image
Here are the methods you can use to select such move sequences from the game:
1. You can add special annotations to moves in the game, which you can refer to in the iBook. These are called anchors. An anchor is a name enclosed in double slashes: “//.” In this example we use // Anchor // and the arrow points to the iBook command that would select the move sequence we are interested in.
2. You can point to a position in the game by giving the FEN string for the position as shown in the second example in the image. Both this method and using anchors give you access to all the moves leading up to this point in the game, starting from move one.
3. The third method is currently my favorite. Here you specify the first move of each variation leading to the variation of interest. The variation starting with 30…Qe8 is a second level variation. It is a sub-variation of the first level variation starting with 29…Qe1+. Therefore the path to our move sequence is "29…Qe1 30…Qe8" as shown in the third example. The difference from the two other methods is that this method returns all the moves to the end of the last variation (the variation starting with 30…Qe8 in this case).
After you have specified a move sequence using one of these methods, it becomes the current line in the iBook. This means that you can display selected moves from the variation simply using their move number. After commenting on the selected moves, you can display the next set of moves, etc.