This is one of several user guides on specific topics. The directory for all user guides is here.
The name “smörgasbord” emerged out of my desire to make it possible for users to make a collection of related recipes, then easily select one recipe from the collection at random. Of course, there’s nothing random about my approach to a real smörgasbord, but I wanted a word that conveyed a nice collection of something, and deal “Recipes” conjure thoughts of food, so here we are at the smörgasbordet. Välkommen.
It is exhausting to type those diacritical marks and I don’t seem to have access to the little circle thing above the letter “a” so please allow me to go on in American fashion without them.
Let’s start with a 4-recipe set whose purpose is to allow each seat to experience the joy of having 13 spades. Let’s create them as we go. Here, North has all the spades. I made the recipe and clicked the Red Button to generate the deal:
Here I have clicked on the “Add Recipe to Smorgasbord” button in the File Saver panel.
Notice that there is a counter next to the “Add Recipe to Smorgasbord” which is now set to 1 because I added one recipe. Notice also that the “Save” button that usually says “Recipe” now says “Smorgasbord”. That’s because, once you add a recipe to the smorgasbord, you cannot save individual recipes to a .bcoarecipe file—you can only save the contents of the internal smorgasbord to a .bcoasmorgasbord file. If you don’t really want to save your smorgasbord to a file but you do want to save a recipe, just reload your browser and the internal smorgasbord will be emptied.
Next, I completed my set of related recipes by clicking the swurvy-curvey button in the Recipe Maker panel to rotate hands one seat clockwise, putting all the spades in East’s hand, then I clicked “Add Recipe to Smorgasbord” again. I repeated those actions two more times to give South and West the spades. When I finished, I had four recipes in the smorgasbord, as shown by the counter here:
So far, nothing has been saved to a file. But the “Smorgasbord” save button is at the ready, so let’s click it:
There’s the smorgasboard file. Let’s use a text editor to peek at it:
That’s some tiny print, but I assure you, it is our four all-spades-in-one-hand recipes, stored in the form of URLs. Note the tell-tale strings of 13 exes which represent the spades marching around the table.
That’s nice, but how would you use this thing? The answer, my friend, is not blowing in the wind—it’s lurking in the File Load panel in the upper right of the page, which now lists “smorgasbord” as one of the types of file that you can load.
Click the “Browse” button and then in the file chooser, select the .bcoasmorgasbord file that you just saved, and you get:
That’s a whole new generator window, with one of the recipes from the smorgasbord loaded. It so happens to be the first all-spade recipe, but it’s a random selection from the four available recipes. Test this by closing the new window, then load from the smorgasbord file again, to get:
This time we got the one with South owning all the spades. That’s the 3rd recipe in the smorgasbord, which is a relief because I was afraid the demo might keep showing them in order from north to east to south to west. But no—it chooses one randomly each time.
That’s a lot of work to be able to choose randomly from among four recipes. But it scales up nicely, and it works for single recipes loaded from a file, as well as from whole folders of recipes. Adding a single recipe loaded from a file works very much like adding a recipe that you just defined in the Recipe Maker panel—just use the File Load panel to load up a .bcoarecipe file, then click “Add Recipe to Smorgasbord” in the File Saver panel, and you have added one more recipe.
How about loading recipes in bulk, from a folder?
Here I have a folder with 96 related recipes:
Why so many recipes for one scenario (1-major opener)? Because individual recipes can only describe one variation on a scenario (though much can be left to random chance within that variation). For instance, to limit opener to 12-21 HCP (we don’t deal in total points) requires at least four variations: 1 for any shape with 12-14 HCP, 1 for unbalanced with 15-17 HCP (to avoid being a 1NT opener), 1 for any shape with 18-19 HCP, and 1 for unbalanced with 20-21 HCP. A recipe can say “any shape AND 12-14 HCP AND 5+ hearts.” But the same recipe cannot also say, “OR (unbalanced AND 15-17 HCP AND (5+ hearts OR 5+ spades).”
The simple declarative nature of recipes only supports implied AND between all the conditions you define in one recipe; you cannot express OR, and you can’t express NOT, and you can’t express grouping of logical expressions. Those things are the province of programming languages.
I have 96 1-major-opener recipes instead of just 4, because for purposes of study and teaching, I want many specific variations on hand. You can see what I’m up to in the file names above—I vary the opener’s point range, responder’s point range, and responder’s degree of support for opener’s suit. Since I can’t easily define a recipe to have (5+ hearts OR 5+ spades), I ended up with 48 recipes for heart openers and 48 recipes for spade openers. I don’t mind—that’s the way it works with declarative.
What I DO mind, though, is always having to navigate to that folder and deciding which recipe to use. It would be nice to have all of those recipes in a smorgasbord, and use the File Load panel to just select the smorgasbord file and let it give me a randomly-selected recipe.
You could certainly construct such a smorgasboard just the way I created the recipes—one at a time…slowly…painfully…with the “Add to Smorgasbord” button.
Or you can load them all at once into a smorgasbord. Here’s how:
Below the Load File panel, there is now a separate panel cleverly named “Add recipes from folder to smorgasbord.” Sometimes a long name is best. I shall click the Browse button in the new panel, and navigate in the file chooser (or folder chooser, in this case) to where I can see my 1-major opener folder. Thar she blows, glistening in pale splendor, her 96 recipes waiting to be smorgasborded, seagulls flocking to pick at the scraps…sorry, different story. Just thar she blows:
I double-click that folder, or press the Upload button of the file/folder chooser. It expects you to select a folder, so plain old files are greyed out. Back on the generator page, witness the glory of the smorgasbord counter down in the File Saver area, and the Save Recipe button again says “Smorgasbord” since we now have 96 recipes stored up but not yet saved to a file:
Let’s go ahead and change the Filename to something meaningful, because this file will be a keeper:
Then click the Save Smorgasbord button, and it’s now in a file called 1_major_opener_recipes.bcoasmorgasbord.
Now, or hours, days, weeks, or months later you happen by and think, “Man, I would love to have a random 1-major opener deal to study.” Fine. Click on “Browse” in the File Load panel and you get a file chooser. Navigate to where you stored your smorgasbord file with all your 1-major opener recipes:
Select the 1_major_opener_recipes.bcoasmorgasbord file (not the “smorgasbords” folder itself) and you should get a new generator page with a randomly-loaded recipe:
Thar she blo…I mean we got the 1-spade opener, unbalanced with 20-21 HCP and with no spade support and puny HCP from responder. Each time you load that smorgasbord file, you will get another randomly-selected recipe.
So that’s it—you can now group related recipes and select something like “1-major opener” instead of having to think about which of 96 (or more) related recipes you want.
You can, of course, make your own sets of related recipes, and I hope you are actively doing that. If you would like to see how I define related recipes, or you want to test the Smorgasbord features without having to make up a lot of recipes, help yourself to my 1-major openers in this ZIP file—just download it and unzip it on your computer.
Happy dealing!