Moderator: Andres Valverde
Alessandro Scotti wrote:Hi Tord,
great news... and you still give the source away... that's crazy!
Anyway I've downloaded the Mac OS X executable... only 3 weeks or so before I can use it!
B e2e4 d7d5 e4d5 d8d5 e1e2 d5e4
Dann Corbit wrote:I have some problems and I am not sure what causes it.
Most of the time, Glaurung loses on time.
Perhaps something is wrong with my book that I got from your site. I chose the one that said Linux and Windows.
If it assumes some particular struct alignment, then I am sure that is what is wrong.
#include <stdio.h>
int main(void) {
unsigned long long x;
int i;
FILE *f;
f = fopen("book.bin", "r");
if(f == NULL)
printf("book.bin not found!\n");
else {
for(i=0; i<10; i++) {
fread(&x, sizeof(unsigned long long), 1, f);
printf("%llx\n", x);
}
fclose(f);
}
return 0;
}
e78289e91994
30000000000
11f449fe80007
30000000000
124efde290113
30000100000
1afd30e893a76
30000000000
1b4ebed3518c0
30000000000
89e91994
0
9fe80007
0
de290113
100000
e893a76
0
ed3518c0
0
#include <stdio.h>
int main(void) {
union {
unsigned long long a;
unsigned b[2];
} x;
int i;
FILE *f;
f = fopen("book.bin", "r");
if(f == NULL)
printf("book.bin not found!\n");
else {
for(i=0; i<10; i++) {
fread(&(x.b[0]), sizeof(unsigned), 1, f);
fread(&(x.b[1]), sizeof(unsigned), 1, f);
printf("%llx\n", x.a);
}
fclose(f);
}
return 0;
}
Jim Ablett wrote:Same result.
#include <stdio.h>
int main(void) {
union {
unsigned long long a;
unsigned b[2];
} x;
int i;
FILE *f;
f = fopen("book.bin", "r");
if(f == NULL)
printf("book.bin not found!\n");
else {
for(i=0; i<10; i++) {
fread(&(x.b[0]), sizeof(unsigned), 1, f);
fread(&(x.b[1]), sizeof(unsigned), 1, f);
printf("%llx %x %x\n", x.a, x.b[0], x.b[1]);
}
fclose(f);
}
return 0;
}
89e91994 e782 89e91994
0 300 0
9fe80007 11f44 9fe80007
0 300 0
de290113 124ef de290113
100000 300 100000
e893a76 1afd3 e893a76
0 300 0
ed3518c0 1b4eb ed3518c0
0 300 0
Jim Ablett wrote:Different result this time >
- Code: Select all
89e91994 e782 89e91994
0 300 0
9fe80007 11f44 9fe80007
0 300 0
de290113 124ef de290113
100000 300 100000
e893a76 1afd3 e893a76
0 300 0
ed3518c0 1b4eb ed3518c0
0 300 0
Jim Ablett wrote:Fast work my friend!
Sure Tord,
I'd be happy to test it for you.
So what will I be looking for? - Just time losses?
book
e2e4 (+42980, =55832, -30896), 54%, n=129708, p=0.417930
d2d4 (+37420, =50441, -23817), 56%, n=111678, p=0.359836
g1f3 (+10305, =16488, -6813), 55%, n=33606, p=0.108281
c2c4 (+10094, =14052, -6311), 56%, n=30457, p=0.098134
g2g3 (+1101, =1531, -747), 55%, n=3379, p=0.010886
b2b3 (+264, =337, -246), 51%, n=847, p=0.001819
f2f4 (+166, =242, -188), 48%, n=596, p=0.001280
b1c3 (+101, =114, -103), 49%, n=318, p=0.000683
b2b4 (+73, =60, -60), 53%, n=193, p=0.000621
g2g4 (+16, =8, -6), 66%, n=30, p=0.000322
d2d3 (+14, =31, -21), 44%, n=66, p=0.000095
e2e3 (+12, =16, -15), 46%, n=43, p=0.000062
c2c3 (+8, =7, -8), 50%, n=23, p=0.000049
fputc(i>>8,fp);
fputc(i-(i>>8),fp);
b = fgetc(fp);
i = b<<8;
b = fgetc(fp);
i += b;
milix wrote:Hi Tord!
BTW, you can make your code endian-free and use the same book binary for both Mac and PC by storing and retrieving bytes and then convert them to integers.
The only way to test whether this new book file works in Glaurung is to play games and observe whether or not the program plays book moves.
Return to Winboard and related Topics
Users browsing this forum: No registered users and 51 guests