summaryrefslogtreecommitdiff
path: root/chess-pos.el
AgeCommit message (Collapse)Author
2014-04-21chess-pos-search*: New function.Mario Lang
Search for several pieces in one swipe of the board, returning an alist of pieces and their indices. Use this in chess-legal-plies for the common case where we want all legal plies for a certain color makes the testsuite time go down to 9m57s.
2014-04-21chess-search-position: 20% performance improvement by treating ray pieces ↵Mario Lang
commonly. When we search for pieces of a certain color, we iterate over all results from all pieces of that color. However, this is redunant as we end up to check the compass rose twice, once for bishops/rooks and once for queens. We actually just need to check all 8 directions once and keep a list of what piece type can move in which direction.
2014-04-21chess-search-position: Move castling check for rooks out of the direction loop.Mario Lang
2014-04-20chess-pos.el: Eliminate unused conditional.Mario Lang
2014-04-20chess-pos.el: Collapse two chess-pos-piece-p calls into one chess-pos-piece ↵Mario Lang
call. Unexpected but true, this increases performance noticeably.
2014-04-20chess-pos.el: Refactor/simplify 10x12 code.Mario Lang
2014-04-20chess-pos.el: Convert 3 more chess-incr-index calls to chess-next-index.Mario Lang
2014-04-20chess-pos.el: Convert 2 more calls to chess-incr-index to chess-next-index.Mario Lang
2014-04-20chess-pos.el: Convert 4 more chess-incr-index calls to chess-next-index.Mario Lang
2014-04-19chess-knight-directions: New constant.Mario Lang
2014-04-19chess-pos.el: Define constant lists of directions various pieces can move to.Mario Lang
This avoid useless consing and makes things a bit more reusable.
2014-04-19chess-next-index: A 10x12 mailbox based function for advancing indices.Mario Lang
This one is a lot faster then chess-incr-index. Casual replacing in some caller sites yields about 30% performance improvement, more to be gained if more callers are converted.
2014-04-18chess-pos-move: Really remove castling ability if rook has been moved.Mario Lang
This one was *very subtle. Looking at the code, we already tried to prevent this case, and it evenw orked for *some* instances. The problem is that castling flags are boolean in the position structure, chess-pos-can-castle determines the rook location from the position if castling flag is true. But we have already moved the rook around in chess-pos-move before we do the fixup stuff, so chess-pos-can-castle is just wrong in some cases. Fix is simple, call chess-pos-can-castle before we modify the position, and use these values later. This fixes the remaining perft mixmatches.
2014-04-07chess-search-position: Also consider opponent king moves when checking for ↵Mario Lang
check. With this the rule that there always needs to be one square between kings is honours in chess-legal-plies. Without this fix, a move next to the opponents king was considered legal.
2014-04-01chess-rf-to-index: Fix assertion.Mario Lang
Should be and, not or. cl-check-type is more clear anyway.
2014-03-31chess-pos.el: Reorder some definitions to pacify compiler.Mario Lang
Also, actually disable assertions during compilation (as intended) which increases performance by roughly 30%.
2014-03-30Fix a rather serious bug in chess-pos-move:Mario Lang
We were checking for king or rook moves to remove our castling flags if necessary, but we did not remove the opponents castling flags if we took one of their rooks. This led to rather invalid positions. You could castle with your king and the opponents piece.
2014-03-24chess-pos-can-castle: Avoid error if there is no king on the board.Mario Lang
2009-12-27char-valid-p is obsolete (as of Emacs 23.1); use characterp insteadMario Lang
2008-09-01When byte-compiling chess-pos, set cl-optimize-speed to 9. This increasesJohn Wiegley
the computation of chess-eco.fen by up to 50% on my system.
2004-02-18(chess-pos-passed-pawns): New function.Mario Lang
2004-01-28(chess-search-position): document arguments check-only and no-castling.Mario Lang
2004-01-26(chess-pos-move): There was a bug in castling removal when a Rook moved, now ↵Mario Lang
compare chess-pos-can-castle and the source square of the moving piece to figure out if we need to remove castling priveledges
2004-01-26(chess-pos-legal-candidates): Remove the opponent pawn if we are capturing ↵Mario Lang
en passant. This fixes a bug where chess-legal-plies does not find an en passant if the pawn to be captured is giving check
2004-01-25Added an argument to chess-search-position, so that if we areJohn Wiegley
searching for the source of an algebraic move, and it is not a castle, then do not check castle moves.
2004-01-07remov chess-pos-read-epd-fileMario Lang
2004-01-03New function chess-pos-read-epd-file, which parses an epd file into a list ↵Mario Lang
of positions
2002-05-01*** no comment ***John Wiegley
2002-05-01added a small commentJohn Wiegley
2002-04-28*** no comment ***John Wiegley
2002-04-26*** no comment ***John Wiegley
2002-04-26bug fixesJohn Wiegley
2002-04-25fixJohn Wiegley
2002-04-24*** no comment ***John Wiegley
2002-04-24*** no comment ***John Wiegley
2002-04-24added support for setting EPD codesJohn Wiegley
2002-04-22Bug fixes and reducing the TODO list.John Wiegley
2002-04-19Fixes and other work.John Wiegley
2002-04-18whitespace fixJohn Wiegley
2002-04-18Many efficiency improvements and bug fixes.John Wiegley
2002-04-17More general bug fixing, efficiency improvements, etc.John Wiegley
2002-04-17*** no comment ***John Wiegley
2002-04-17*** no comment ***John Wiegley
2002-04-17*** no comment ***John Wiegley
2002-04-16More efficiency improvements.John Wiegley
2002-04-16Fixed pos status not being updated.John Wiegley
2002-04-16Report checkmate in the modeline correctly.John Wiegley
2002-04-16Removed the $ Revision strings; they are no longer necessary since IJohn Wiegley
tag every revision that I upload.
2002-04-16Major speed improvement and efficiency work. chess-legal-plies isJohn Wiegley
much more memory conservative now. Reduced recursion in chess-search-position by a slight bit.
2002-04-13added message catalog supportJohn Wiegley