jniemann66 / react-chessdiagram

Chess Diagram React Component
MIT License
26 stars 10 forks source link

read adjacent digits as one number #5

Closed svangordon closed 7 years ago

svangordon commented 7 years ago

I thought about it a bit more and I realized there's no reason we can't read the number of blank squares in a FEN string naturally.

jniemann66 commented 7 years ago

Yes, this works great ! I like the use of reduce() - that was a nice idea.

I did a quick search on some chess sites like CPW, but I couldn't really find much of a consensus on how to encode large boards with FEN.

However, in the wikipedia article on x-FEN, in regards to 10x8 Capablanca Chess boards, it states:

Ten consecutive free squares in a rank are encoded by "10", and nine free squares are represented with a "9"

So, I'm inclined to think that this is indeed the correct approach.