Skip to content

Commit

Permalink
Small fixes to nnue
Browse files Browse the repository at this point in the history
  • Loading branch information
tahle committed Apr 19, 2023
1 parent 89d6741 commit 10e9338
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sunfish_nnue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from collections import namedtuple
import numpy as np
from functools import partial
from contextlib import contextmanager

print = partial(print, flush=True)

version = 'sunfish nnue'
Expand Down Expand Up @@ -227,11 +229,11 @@ def move(self, move):

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

# Castling
if p == "K":
pos = pos._replace(wc=(False, False))
self.wc=(False, False)
if abs(j - i) == 2:
self.kp=(i + j) // 2
self.put(A1 if j < i else H1, ".", stack)
Expand Down

0 comments on commit 10e9338

Please sign in to comment.