Skip to content

Commit 10e9338

Browse files
committed
Small fixes to nnue
1 parent 89d6741 commit 10e9338

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sunfish_nnue.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from collections import namedtuple
66
import numpy as np
77
from functools import partial
8+
from contextlib import contextmanager
9+
810
print = partial(print, flush=True)
911

1012
version = 'sunfish nnue'
@@ -227,11 +229,11 @@ def move(self, move):
227229

228230
# Capture the moving king. Actually we get an extra free king. Same thing.
229231
if abs(j - self.kp) < 2:
230-
self.put(pos, self.kp, "K")
232+
self.put(self.board.find('k'), ' ')
231233

232234
# Castling
233235
if p == "K":
234-
pos = pos._replace(wc=(False, False))
236+
self.wc=(False, False)
235237
if abs(j - i) == 2:
236238
self.kp=(i + j) // 2
237239
self.put(A1 if j < i else H1, ".", stack)

0 commit comments

Comments
 (0)