jasoncreighton / snowy Goto Github PK
View Code? Open in Web Editor NEWUCI chess engine written in C++
License: MIT License
UCI chess engine written in C++
License: MIT License
Haven't tried to get to root cause at all yet, but here's an example: (bestmove should not flip to a2a4)
Snowy 0.1-34-g363c195 by Jason Creighton (built on Jan 6 2018 12:18:49)
d
a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
a b c d e f g h
Hash: e08cc2b35b8ee749
go
info depth 1 score cp 55 time 0 nodes 20 pv b1c3
info depth 2 score cp 0 time 0 nodes 133 pv b1c3 b8c6
info depth 3 score cp 55 time 0 nodes 721 pv b1c3 b8c6 g1f3
info depth 4 score cp 0 time 4 nodes 3465 pv b1c3 b8c6 g1f3 g8f6
info depth 5 score cp 14 time 13 nodes 15408 pv b1c3 b8c6 g1f3 g8f6 a1b1
info depth 6 score cp 0 time 63 nodes 102853 pv b1c3 b8c6 g1f3 g8f6 a1b1 a8b8
info depth 7 score cp 34 time 246 nodes 409115 nps 1657557 pv d2d4 g8f6 b1c3 b8c6 g1f3 a8b8 c1e3
info depth 8 score cp 0 time 2070 nodes 3415371 nps 1649170 pv e2e4 b8c6 g1f3 g8f6 b1c3 e7e5 f1d3 f8d6
bestmove e2e4
go
info depth 1 score cp 55 time 0 nodes 20 pv b1c3
info depth 2 score cp 5 time 0 nodes 20 pv a2a4 g8f6
info depth 3 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3
info depth 4 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6
info depth 5 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3
info depth 6 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6
info depth 7 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6 f1d3
info depth 8 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6 f1d3 e8g8
bestmove a2a4
Right now we are assuming that if the Zobrist hash matches, it must be the same position and therefore we can apply the move.
We should first check if the move is pseudo-legal before calling Board::Make(). (Note that Make() does look at whether the king would be left in check, but it doesn't verify that the move itself was pseudo-legal to begin with, so, eg, you might have a knight being moved like a bishop or some nonsense.)
When running tournaments, I've noticed cutechess-cli sometimes reports an illegal move in the PV. I've not seen it report an actual attempt to play an illegal move.
The move always seems to be a castling move.
Would be nice to support Chess960
This should be configurable over UCI
in Board.cpp line 436:
// Update 50 move rule counter
if(isCapture || isPawnMove) {
m_NumReversiblePlies = 0;
} else {
++m_NumReversiblePlies;
}
This one doesn't consider castling as an irreversible move. Also, I think losing the castling right (king on e1, rook on h1 with castling right, but you move Ke2) should reset the counter, too. I will need to check the FIDE rules on this latter.
EDIT: this latter (the losing of the castling rights in an 50-move scenario) is astronomically rare in the wild, still, it would be nice to obey the rules totally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.