l never managed to decode it, though. Under windows, there seemed to be a frame shift somewhere which made all but the first few hundred records corrupt. Under linux, that frame sihift did not appear for some reason (does this make sense?), but I have problems with the byte order. After half a day of detective work I managed to decode the deal part of it, but the DD analysis part of it still doesn't make too much sense.
Does anybody have a c or c++ routine that can read the records? The result of my detective work is at the end of this post, but as said the "tricks" field does not seem to be correct.
Then the "deal" program". The makefile does not work under Ubuntu. I made the following changes:
- removed the target specification "counttable" in Makefile
- changed the include of "tcl.h" to <tcl.h> in deal.h
- linked "deal" manually with tcl8.4.so.0
Now it works! I'm so proud everytime I manage to get something working under Linux
=========================================================================
typedef struct {
long suits[4];
short tricks[5];
} inprectype;
char directionsymbols[4] = "WNES";
char denominationsymbols[5] = "nshdc";
char cardsymbols[15] = "0023456789TJQKA";
void readrec ( char *buf, inprectype *res ) {
int suit, denom;
char *buf2= (char*)res;
for(suit=0; suit<4; suit++) {
buf2[3]=buf[0];
buf2[2]=buf[1];
buf2[1]=buf[2];
buf2[0]=buf[3];
buf=&buf[4];
buf2=&buf2[4];
};
for(denom=0;denom<5; denom++) {
buf2[1] = buf[0];
buf2[0] = buf[1];
buf=&buf[2];
buf2=&buf2[2];
};
};
#define getplayer(inputrec,suit,card) (3 & ((inputrec->suits[suit]>>(28-2*card))))
void getsuit(inprectype *inprec, long player, int suit, char *res) {
int card;
// printf("getsuit:");
for(card=14;card>1;card--) {
// printf(" %d", 3 & (inprec->suits[suit]>>(2*card+2)));
if(getplayer(inprec,suit,card) ==player) {
// if((3 & ((inprec->suits[suit]>>(28-2*card)))) ==player) {
*res = cardsymbols[card];
res=&(res[1]);
};
};
*res = '\0';
// printf("\n");
};
int getsuitlen(inprectype *inprec, long player, int suit) {
int card;
int res=0;
for(card=14;card>1;card--) if(getplayer(inprec,suit,card) ==player) res++;
return res;
};

Help
