Skip to content

Commit 6cfbc40

Browse files
committed
Some cleanup and provide actual performance result
1 parent c5669f6 commit 6cfbc40

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ pfkpk: pfkpk.c kpk.c kpk.h
88
test:
99
./pfkpk
1010

11-
clean:
12-
rm -f *.o
13-
1411
# vi: noexpandtab

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@ the file `LICENSE' for details.
99
This implementation is quite fast because it handles the 64 possible
1010
black king locations superposition in all operations.
1111

12+
```
13+
kpkGenerate CPU time [seconds]: 0.001579
14+
kpkTable size [bytes]: 32768
15+
kpkSelfCheck: OK
16+
kpkProbe 24/24: OK
17+
```
18+
1219
The implementation is agnostic to board geometry. See the file
1320
`kpk.h' for instructions on how to adapt to an alternative square
1421
indexing.
1522

1623
Distance to conversion (DTC) is not provided, but is trivial to
1724
add. Please contact the author if you need advice.
1825

19-
Marcel van Kervinck
26+
Marcel
2027

2128
```
2229
/*

kpk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ int kpkGenerate(void)
103103
{
104104
uint64_t valid[64*32];
105105

106-
// Prepare won
107106
for (int ix=0; ix<arrayLen(kpkTable[0]); ix++) {
108107
int wK = wKsquare(ix), wP = wPsquare(ix);
109108

@@ -115,6 +114,7 @@ int kpkGenerate(void)
115114
kpkTable[black][ix] = lost;
116115
}
117116

117+
// Valid positions after black move, pawn capture allowed
118118
valid[ix] = ~king64(bit(wK));
119119
if (file(wP) != fileA) valid[ix] &= ~bit(wP+N+W);
120120
if (file(wP) != fileH) valid[ix] &= ~bit(wP+N+E);

0 commit comments

Comments
 (0)