Thursday, 28 November 2024

To Resign or Not to Resign...

 I was intrigued by this brevity I found in the Wolverhampton Express and Star for 11 October 1950...



The print is a bit fuzzy so here's the game in a more user-friendly format...

You will notice that the columnist awards an exclamation mark to Black's 5th and 6th moves. That said, he suggests that 7 Qh5 might have been tried, with 7...g6 being met by 8 Qg5+ and 7...f6 being met by "NxPch" except that there is no such move available so maybe he meant 8 Ng6+.

But anyway, here's a poser for you. What should White do in the final position after 6...Ke7? Should he (a) resign; (b) follow the columnist's advice and play 7 Qh5; or (c) play something else? (and if so, what?)

White was the Rev. (Eric) Gilbert Wood (1901-79), the Rector of Beckbury in Shropshire, who later retired to Hastings to spend more time with his chess pieces. I've found two more of his games which were also over in six moves.

On the above occasion the Resigning Rector clearly did the right thing as Bxf7+ followed by Qe6 mate is not hard to foresee.

In our final six-move fiasco, which pre-dates the other two, the Reverend Wood was the victor...

Imagine the elation the clergyman felt later on seeing the score published in CHESS magazine, where it was declared to be the shortest game of the 1948 British Championship congress. But, as it says in Proverbs 16:18, "Pride goeth before destruction, and an haughty spirit before a fall."

Here endeth the lesson.

Tuesday, 26 November 2024

MORE ADVANCED CHESS DATABASE SORTING

We've already had a look at ways of sorting a chess database using ChessBase. Let's quickly recap: in ChessBase you can sort a database based on the game date or the tournament start date. One or the other, but you can't combine the two, or add in more sort options as you can in more sophisticated items of software such as spreadsheets.

Just yesterday I needed to sort an old file of games from Division 3 of the 4NCL (British Team League), season 2001/2. There were 12 teams of eight players taking part in a all-play-all, round robin event between October 2001 and May 2002. I like to pack as much meaningful information into the Tournament field as possible, so I decided on the following standard name...

4NCL/2001-02/D3/xxx-yyy

... thus showing the league name, the season, the division, plus short codes (represented here as xxx and yyy) for the two teams involved in the match (e.g. WS = Warwickshire Select or PP2 = Poisoned Pawns 2nd team). Of course, this latter information can also be stored in the White Team and Black Team fields, but I like to have it visible in the tournament index.

I also use the round and sub-round fields, where the former is self-explanatory and the latter is used to show the board number within the individual match. My desired overall sort order is of course chronological. I like to group individual matches together in board order, top to bottom, as per the following image...

Image 1: the desired sort order for the 4NCL 2001/2 Division 3 games. Each eight-game match is grouped together with a discrete name, round by round, and in board order, top to bottom.

Image 1 above shows you the desired end product with the relevant data for each game, in what is probably the most logical order. 

That's how we want the database sorted, but let's suppose our starting point was the same database but in a completely random order, e.g. as shown below in Image 2...
Image 2: here's the same database but in scrambled order. What we want to achieve is to transform the random order of Image 2 into the logical sequence shown in Image 1.

OK, how to go about sorting the random order of Image 2 into the logical order shown in Image 1. 

HOW NOT TO SORT THIS DATABASE...


One thing we might try is to click (twice) on the Date tab, which produces the following...

Image 3: the database shown after double-clicking on the Date tab (encircled in red). But it's not the sort order we want as it groups all the board 1s together (see the column indicated by the arrow) rather than showing all the boards of each match grouped together. 

If you look closely at Image 3 you can see that our simple sort using the Date field has not worked as it groups together all the board 1s for a particular date, then all the board 2s, etc, etc. That's not what we want.

HOW TO SORT THIS DATABASE... SUCCESSFULLY, THIS TIME


OK, so let's go back to the start and see if ChessBase's built-in Sort Database function can do the trick. Go to the CB database window...

Image 4: using the built-in ChessBase sort function. Right-click on the database you want to sort, move the mouse down to TOOLS and then click where you see SORT DATABASE.

As explained in a previous post, you can sort a database from the database window. Highlight (single-left-mouse-click) the database you wish to sort, then right-mouse-click to display a further drop-down menu, move the mouse pointer to where it says TOOLS, which opens up a further drop-down menu, move the mouse pointer across to where it says SORT DATABASE and left-mouse-click.

You will be asked to choose between an ascending and descending sort - default is ascending so just click on OK.

Now if you go back and look at the database, you'll find yourself it looks like Image 1. Yes, it's good news, the operation was successful. Congratulations, you are now the proud owner of a logically-ordered sort database.

Here's how ChessBase have documented the Sort Database facility in the Advanced Database Management section of their CB14 Help pages.

Sort database
Sort the games of a database according on year and tournament only and fixes this sort order. You have the choice between ascending or descending. This function is maintained from the CB 8 program because some users do not like to see that some functions are disappeared.

There you have it (in slightly sub-standard English): the tournament field is an integral part of the sort and helps to put the games in the order we need. (I was slightly perturbed to read the last sentence which seems to hint that the ChessBase company itself is not committed to the idea of retaining this function - which I would have thought was essential - but have, perhaps reluctantly, bowed to user pressure. Maybe I'm reading too much into it.)

WHAT HAPPENS IF YOU DON'T INCLUDE CODES FOR TEAMS...


Let's consider what happens if the tournament field doesn't include those team codes.

You will recall that we built in short codes denoting the teams into the tournament field, e.g. WS = Warwickshire Select, GUI3 = Guildford 3rd team. The underlying reason for including these codes was to make ChessBase's built-in sort function do the job properly. 

Or so I thought... before going on I should add that all of the games in this database have the White Team and Black Team fields filled in as you can see from this image of the Team index tag...

Image 5: the Team index tag shows the team names with dates and flags,
and tells us that all 480 games in the database have this information.

Now the test database includes the team fields but doesn't have short codes for the teams in the tournament field, so it shows as exactly the same for every game, thus 4NCL/2001-02/D3, indicating the identity of the competition, the season and the division of the league.
Image 6: the test database in random order, showing you the simplified tournament identifier, minus the short team codes, but showing full team information in the White Team and Black Team fields, as indicated by the red arrows.
Now we can run ChessBase's built-in Sort Database again (see Image 4 above) and see what happens.

Here I was agreeably surprised. Having read the CB14 Help information, I thought it might simply refer to the tournament field - now the same for all games, so no longer useful for sorting - and then refer to the date field and the round/sub-round data, producing a similar failure to the one shown in Image 3, with all the board ones grouped together in each round.

But I was wrong! It worked perfectly and produced the following result...

Image 7: a perfect sort, showing games grouped into matches, in board order. 

There you have it: ChessBase's sort worked exactly as required, grouping matches correctly in board order. And a bit of later testing showed me that it works correctly because it makes reference to the team names saved with each game and is 'clever' enough to use them to group games together into discrete matches. That seems to indicate that, to achieve a logical sort of a team chess database, you need either to supply different tournament fields for each match played or else make sure every game has the two teams identified.

A caveat: CB functions can differ between different versions of the software, and it is also important to apply all the software updates that are available. It is quite possible that earlier versions won't produce the same result.

A THIRD SCENARIO - NO TEAM NAMES


What happens when the games don't have team names for the players or different tournament data for each individual match? In those circumstances the sort function doesn't have anything to work from other than game date plus round/board numbers. So once again it gives you all the round 1, board 1s, followed by the round 1, board 2s, etc, which is not what is required.

A popular work-around in these circumstances is to edit the sub-round data so that the sort works. So, using our 4NCL example, you attribute a notional number between 1 and 6 to each of the six first-round matches. So for the first match you enter the sub-round data for board 1 as "11", board 2 as "12", etc, up to "18" for the bottom board. Then for the second match of that match you enter the top board sub-round data as "21" and the rest of the boards similarly "22", "23", etc. You can see that the software will then happily sort them into the desired order. But it's an unsatisfactory bodge of a solution, of course. If you publish games like this, end users may be puzzled as to what the significance of the sub-round data is.

That's it for this post. Good ChessBasing to all my readers.









Saturday, 23 November 2024

Using ChessBase: To Sort or Not to Sort, That is the Question

This is the second in what could become a series of occasional technical posts about using ChessBase software. The first such post was a guide to sending games via email. This time I'm considering different ways to sort ChessBase databases and their pros and cons. 

Hereafter I'll abbreviate ChessBase to CB. Note that I use CB version 14 and you need to be aware that earlier or later versions of the software may work in a different way or have different menu designations.

DO YOU REALLY NEED TO SORT A DATABASE?

First, a philosophical question for the reader: do you really want or need to sort a database? The reason I raise the question is that there can be valid reasons for leaving a database unsorted. Sometimes it can be useful to retain the order in which games are added to a database (which would no longer be available after a sort). For example, the database which I use to store the entirety of games on the BritBase.info website which I maintain I often leave unsorted for long periods of time. It acts an an aide-memoire to see what I have added recently and what I have been working on. There are other ways of achieving this but the easiest way to do so is by leaving it unsorted. 

VIEWING SORTED DATA IN AN UNSORTED DATABASE

It is also worth noting that CB has facilities which allow you to view games in various logical orders even when a CB database as a whole is unsorted. We can think of these as a temporary sort

For example, you can still view a specific player's games in chronological order despite the database being unsorted. You can do this via the Player Index, which is one of the best features of the software. 

Here are the steps to see a player's games in chronological order in an unsorted database:

  • In the database window, CTRL+P takes you to the player index (or click on the Player tab if you are already in the list window for that database). 
  • Then find and highlight the player you are interested in and you should see a list of games on the right side of the screen. 
  • At the top of the right hand window, you can now click on the Date tab to show you the games of that player in chronological order (you can click multiple times to see the game in descending order, revert to ascending, etc)

Note that the above steps produce no permanent change to the database order. It's simply a temporary way to view data in a desired order. 

Much the same can be done to view games played in a specific tournament where the individual games could be anywhere in an unsorted database. The Tournament Index is another excellent CB feature which many users neither use nor appreciate.

Here are the steps to see the games of a tournament in round order in an unsorted database:

  • In the database window, CTRL+T takes you to the tournament index (or click on the Tournaments tab if you are already in the list window for that database). The left-hand column shows the tournament names while the right-hand column shows the games contained in the highlighted tournament.
  • Then find and highlight the tournament you are interested in. A good way to do this is to use the search window at the bottom of the left-hand column. (see the image below) Click in the box there and type in, e,g. "1973 hast" and it should show you entries for the 1973/74 Hastings tournament. But type quickly! This is a quirky feature of CB which triggers a matter of seconds after you start typing in the box. It doesn't wait for you to press send after typing. Remember the old proverb "he who hesitates is lost": when you're used to the speed-typing necessary to use it properly, you'll realise it's a powerful search facility which finds what you want very well. Alternatively, just page down alphabetically, or use the Tournament Start Date tab to navigate to what you want.
  • Once you've highlighted the tournament you are interested in, you should see a list of games on the right side of the screen. 
  • They may not yet be in round order, so click on the Round tab in the right-hand window and they should now be displayed in round order.
A ChessBase Tournament Index window, with the search field encircled in red. Use this facility to find specific years, tournaments and places on your database - but type fast!


ARE YOUR PLAYER AND TOURNAMENT INDEXES IN GOOD SHAPE?


A snag (there are always snags in CB): your Player Index and/or Tournament Index may not be in good enough shape to make the above work to perfection. 

For example, you may have different versions of a player's name, e.g. a well-known Norwegian player may be listed as Carlsen, Magnus or Carlsen, M or Magnus Carlsen or heaven knows what else. You'll need to sort this out before a temporary sort can include all of said player's games. I might write another post about how to do that in due course.

Also note that the CB Player Index places surnames which start with a lower case letter below all of those which start with an upper case letter. Hence, for example, "de Veauce, Louis" (and a multitude of Dutch "van"s) will be below "Zukertort, Johannes".

Even more likely is that you will have different versions of a tournament's games. For BritBase I try to standardise tournament identifiers but it takes time and it is understandable that many CB users are less careful about this. This might be the subject of another post in due course.

HOW GOOD IS YOUR START DATE?

Warning: a major snag with the Tournament Index is that the start date is often either missing or wrong. Inexperienced inputters may be oblivious to the need for, or the existence of, a start date as it does not appear in a CB game window, nor does it show in the basic CB 'save game' window. Start dates are only readily visible on a Tournament Index page where you can see them given in the 'Tournament start' column.

The start date is the date on which a tournament or competition begins and will (or should) be the same for every game played in that specific competition. 

When a game is input and added to a database, the basic 'save' screen invites the user to type in a game date. However, there is an additional start date which can (and should) be entered in an additional window which only appears when you click on the 'Details' button in the basic 'save' window.

Inexperienced ChessBase game inputters often neglect to include the start date.
Clicking on the DETAILS button (circled in red) leads to the following screen...
... where you can input the tournament start date in the field circled in red. Unless the date entered here is accurate, then a Method 2 sort will not produce accurate results.

An example of a Tournament Index window, with the tournament start date encircled in red.

OK, YOU REALLY WANT TO SORT THE DATABASE - HERE'S HOW


I'm assuming that you, the reader, have now read all the disclaimers and warnings and suggested alternatives but are still bent on sorting the database and want to know how. "A most courageous decision, minister!" as Sir Humphrey would say in the TV show Yes, Prime Minister.

No, seriously, it's not that big of a deal but I really must insist that you do one thing before taking any of the steps below and that is...

BACK UP YOUR DATA!!

... and don't come whining to me if you fail to do this and it all goes horribly wrong.

Backing up a database - or creating an archive, as it sometimes referred to - is essential before major changes such as sorting. It's also good practice when you've entered an appreciable number of new games. It's easy and doesn't take any time at all (assuming the database you're saving isn't a whopper).

How to back-up 
  • go to the Database window
  • highlight the database you want to back up
  • CTRL+Z
  • it offers you Encrypted or Unencrypted, Take the default option (unencrypted) and click OK.
  • it will then prompt you to save to a file (suffix *.cbv). Its suggested name will usually be OK for most purposes so you can simply click OK.
That's it, you're done. You can sleep easy in your bed knowing that all those positional masterpieces you played for Little Piddlington 'C' team in division five of the Barsetshire League, contributions to the theory of Damiano's Defence, etc, are saved for posterity.

Sorting a CB Database


There are actually two ways of sorting a CB database which I shall dub Method 1 and Method 2. In a Method 1 sort, the basis for the sort is the game date. It takes no account of the start date or whether the database has games from different competitions. Hence it will probably only be useful for sorting a database of games from a specific tournament or (division of) a league. A Method 2 sort is based on the start date and can be used on a database which has many different competitions included in it, but depends on the start dates of games to be accurate in order to produce a reliable chronological order.

Something to be aware of is that a Method 1 sort only works with absolute precision when you have a full date for each game. Thus, if a game has only the year and not month or day, it will sort those games at the start of that year. Let's imagine you played in Hastings Challengers 1973/74. If any of your 1974 games doesn't have a full date and is just dated "1974" then the sort defaults to the beginning of the year - it will plonk the 1974 game right in the middle of those Hastings games after the December 1973 rounds but before the January 1974 ones. (Even if the game is dated "1.1974" i.e. sometime in January 1974, the same will happen.) That's not the end of the world as this can be manually adjusted later. Another anomaly: if you have entered the games of a rapidplay tournament (all played on the same day) in the order you played them but not specified the round numbers, then a sort of either method can randomise the order in which they appear. In this case you might want to add round numbers to those games before proceeding. 

Here's how to apply Method 1.

1) in the game list, click on the date tab to put the games in chronological order (click the tab a second time and it will put them in reverse chronological order) - when it shows the order you want (presumably oldest game first), you are ready to proceed. What you have done so far is a temporary sort which we now want to make permanent...
2) click on the GAMES drop-down menu right at the top of the page (n.b. this is not the Games tab immediately above the list of games, but the top-level drop-down menu item that comes after STATISTICS)
3) click on the FIX SORT ORDER option. It will ask you to confirm, click OK.

That should do it. (It's just possible that it's different in your version of CB - mine is CB v14 - but I think it's a fairly standard feature.)
An example of a ChessBase game list: to effect a temporary sort of the games into chronological order, simply click on Date (encircled in red). (N.B. don't confuse the 'Games' tab (also encircled in red) with the 'Games' item in the top-level menu). Now, let's suppose you've clicked on Date and want to make the sort permanent...


... the games are now in strict chronological order (but notice how games from different sections are mixed up together - you may or may not want this - also, games without month or date go before the others... and one game looks to have an inaccurate date). If you're happy with this temporary sort, you want to click on 'Games' from the top-level drop-down menu, in order to access the 'Fix Sort Order' button.


Method 2 is an arguably simpler way to sort a database which produces almost (but not quite) the same chronological order. Before doing so, the same recommendation as before - make a back-up. You should also take heed of the above warning about 

Method 2 does basically the same thing as Method 1 but there is a subtle difference. For example, unlike Method 1 which works on strict chronological order based on the game date, a Method 2 sort uses as its basis the start date. If you have games played in the same event with identical tournament identifier and start dates, but which are played on different dates spread over the course of a chess season, then it will use the start date to group them together in a block regardless of the fact that games in other competitions may have been played between the event's start and end dates. (And, as pointed out above, if you know the start dates for games in the database to be wrong or missing, then a Method 2 sort will produce unsatisfactory or unreliable results.)

For example, if your 4NCL games for a season, played, let's say, between October 2001 and May 2002, all have the same tournament identifier, a Method 2 sort will use the start date as the basis of the sort to place the first game, and then the rest of the season's 4NCL games immediately after them. There will follow all the other non-4NCL games played in that season subsequent to the 4NCL first round. So you could find a game played in the 4NCL on 1 May 2002 followed by a game played in the London League on 10 October 2001. This doesn't have to be the end of the world but you should be aware. 

1) in the initial database window, left-mouse-click to highlight the database you are intending to sort
2) right-mouse-click the database to show a sub-menu
3) hover over TOOLS which will show a further sub-menu
4) click on SORT DATABASE
5) it will offer you a choice of ascending and descending order. Click OK.