logoalt Hacker News

utopiahlast Saturday at 9:37 PM2 repliesview on HN

> surprisingly readable and surprisingly strong chess engine in 111 lines of Python

Link I get shows 500 lines and it starts with 50 lines of piece-square tables. Maybe it's obvious when you are into the domain but otherwise... that's pretty much of opposite of what I would call "readable".


Replies

svatlast Sunday at 1:46 AM

It appears that the “111 lines” is a reference to the version as of 2014-02-11: https://github.com/thomasahle/sunfish/blob/e2b7fc29ce2a112be... (386 lines), about which the author says (https://www.reddit.com/r/programming/comments/1xmj1a/comment...):

> I got 111 by deleting the tables in the top, and the UI code in the bottom, and then running 'cloc' on the result. That gave 20 blanks, 56 comments and 111 lines of code. ;-)

Recursinglast Saturday at 9:44 PM

Yes it's "surprisingly readable" only for being so strong and so concise, definitely not production code.

The file is 500 lines because of the piece square tables (as you mentioned), comments, and the CLI interface logic

Previous HN thread here: https://news.ycombinator.com/item?id=20068651