Journal Entry #11
I caught up with something that’s been worrying me a long time today. I added support for the “result” of the game both onscreen and in .pgn files generated by Tarrasch. This is a small but essential detail. Until today loading a game would show all the moves, annotations and comments … except for one essential piece of information, the result of the game. In this context the result can have four values only; “1-0”, “0-1”, “1/2-1/2” or “*”. This last value is used for “lines” rather than “games”, it’s important as the last token of text in a .pgn file, but I don’t bother displaying the asterisk on screen.
You might wonder why such an apparently trivial thing would “worry” me. Well the trouble is, that the result appears in .pgn files as a kind of special move, and I was worried that I would have to make a fundamental change to my move trees to support this special, odd kind of move. I started out on that track this morning, but not for long, it was just going to cause too many changes. With a sigh of relief I identified and implemented a simpler solution, basically making the result an (optional) attribute of a move within a tree. Moves already have other optional attributes (like whether the move is followed by a comment), and this approach was very simple by comparison. The downside is that the size of my move trees has increased, since every single node within the tree needs this new optional attribute. But as I mentioned a few posts ago, it is not a good idea to over optimise for performance at this stage of the development. Better to take the simplest route and optimise later if it’s really needed.