[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Today I modified castling as I described earlier. I also rewrote a big chunk of the code. It is a do loop that includes various tests for modifying piece values. It loops as long as it makes changes. If it goes through once without making any new changes, it stops. I used to run an earlier version of this loop after all the moves. But to speed up the identification of pieces, I placed it after each move. This also replaces the code that makes further changes based on the particular move just made. It includes two main types of tests. One type tests whether the possible pieces of a particular type matches the number in the game. If so, it converts these possible pieces to actual pieces. The other type of test checks whether all of a piece type have been found. If so, it turns off the bit for that piece in any remaining pieces for which that bit is still set. Besides these, there are some tests that try to identify the King after both Rooks have been found or try to identify the Rooks after the King has been found. These come in the same two types. One test identifies the actual piece, and one turns off the appropriate bit in other pieces.