4 ms·
Correct me if I'm wrong, but that looks like 388 lines of Python? Still, very cool. I spent awhile trying to write my own and failed miserably. :)
by Jemaclus 12y ago
Correct me if I'm wrong, but that looks like 388 lines of Python?
Still, very cool. I spent awhile trying to write my own and failed miserably. :)
- JonnieCache 12y agoI'm guessing it comes to 111 if you remove the comments.
- nobodysfool 12y agoYes, that is 388 lines, however, the title makes reference to the chess engine itself. The rest of the code, such as setting up the board, handling moves, and ui, are not specific to the sunfish implementation, they can be used without the engine.
- erikb 12y agoIt would be much easier to read if the 111 lines where separated into their own file, though. Otherwise it's hard to discuss what is really important for the engine and what isn't. Sidenote: independent from the discussions about the lines I consider it an awesome piece of work. Even in 388 lines it's still much better than what I could deliver.
- davidghiz 12y agoThe comments and empty lines amount to around 200 lines, OP is not counting those I suppose.
- e12e 12y agoNo: wget 'https://raw.githubusercontent.com/thomasahle/sunfish/master/sunfish.py' egrep -v '^$|^ *#' sunfish.py > sustrip.py wc -l *py 388 sunfish.py 263 sustrip.py (or: equivalently:) egrep -c '^$|^ *#' sunfish.py 125 #Comments, empty lines egrep -c '^$|^ *#' sunfish.py -v 263 #Non-empty lines, non-comment lines I believe the actual chess engine might be 111 lines, though.
- njharman 12y agoWhether or not the constitute "Python" code is debatable. But it is common practice to not count blanks and comments when stating LoC.