Post by Alan GrunwaldMy club (in England) purchase duplimated hands from the County. We
use our own home-brew system to publish results on the web. We have
been offered machine-readable files in a variety of formats. with the
hand data and I would like to modify our system to add this to the
web pages.
Where can I obtain details of Dealmaster (.dlm) or Duplimate (.dup) files?
DLM is the easier format of the two to understand. It uses the Windows
INI text-based structure:
[SECTION]
KEY=VALUE
KEY=VALUE
.
.
.
[SECTION]
KEY=VALUE
.
.
If you're looking to decode it, everything you want is in the
[Document] section. The key fields you need are:
From Board=X
To Board=Y
Board NN=<board data><checksum>
There should be Y+1-X "Board NN" key/value lines.
<board data> is always 26 characters long. Each character is an
alphabetic letter between a and p, representing the numbers 1 to 16.
Each number encodes two hand positions (1="NN" through to 16 ="WW").
Once decoded, you have a 52 character string of hand positions
(N/E/S/W) that maps to a card deck, organised SHDC (4 x AKQJT98765432).
eg:
Board 01=jlifaelnecgmoldfjmcflinlap023
This decodes like this:
j l i f a e l n e c g m o l d f j m c f l i n l a p
SE SW SN EE NN EN SW WE EN NS ES WN WS SW NW EE SE WN NS EE SW SN WE SW
NN WW
And now you have the mapping between hands and cards.
I didn't work out the checksum (but I know both the board data and
board number are incorporated), but that's only critical if you're
trying to _write_ a DLM file.
DUP is an older format, and comes in (at least) two variants.
The original layout was a fixed-width 78 character format, like this:
<North><East><South>
Where each of the North, East and South hands are coded as a sequence
of 13 two-digit numbers, each number being an index into the SDHC 4 x
AKQ... "deck".
The West hand is not represented at all, as by definition it's the
remaining cards.
Each board is on a separate line (CRLF separated), and there's no board
numbering in the format - the first line is board 1, and they go up
from there (until you run out of boards/lines).
eg, if one hand looks like this:
07141517182022272935414452
This decodes thusly:
07 - S8
14 - HA
15 - HK
17 - HJ
18 - HT
20 - H8
22 - H6
27 - DA
29 - DQ
35 - D6
41 - CK
44 - CT
52 - C2
A later version widened the format to 156 characters, like so:
<original 78-char NES
representation><North><East><South><West><Flags><From><To><space>
and removed the CRLF board delimiter (or may have made it optional).
The new <Hand> representation is mostly textual, consisting of 17
characters in total (4 suit markers, each followed by the cards held in
that suit, in SHDC order), like this:
[6]8[3]AKJT86[4]AQ6[5]KT2 (same hand as above)
Each suit marker is a single ASCII character (shown as [X]). I have no
idea why the set isn't sequential.
<Flags> is a three character set of flag fields ("YN1" in every DUP
I've looked at).
<From> and <To> are board numbers, formatted as three characters with
leading spaces as necessary (" 1", " 26", "104", etc). Note that the
boards are not individually numbered.
Finally, there's a single padding space (not sure if this can be
anything else, nor why it's even there).
Notice that the absent West hand from the original 78 character
representation *is* defined in the textual version that follows it.
--
Steve Foster
For SSL Certificates, Domains, etc, visit.:
https://netshop.virtual-isp.net