towforce wrote: ↑Sun Jan 12, 2025 10:31 pm
To save us ploughing through your code in GitHub, could you provide an outline of how your program works, please?
The most essential line in the source code is the ranking composition:
-- Chess Position Ranking
cpr :: Ranking URPosition
cpr = sideToMoveRanking `composeURI` (caseRanking `composeRI` wArmyStatRanking `composeURI` bArmyStatRanking `composeRI` guardRanking `composeRI` enPassantRanking `composeURI` epOppRanking `composeURI` sandwichRanking `composeRI` opposeRanking `composeURI` pawnRanking `composeURI` castleRanking `composeURI` wArmyRanking `composeURI` bArmyRanking `composeURI` pieceRanking) $ emptyURPosition
First, we pick the side to move, then we pick numbers of unmoved rooks and number of en-passant pawns, then we pick the white army statistics (#total #pawns #promotions #factorial_product), then we pick the black army statistics, then we check whether the promotions in the two armies are feasible, then we pick a possible en-passant location or not, then we pick whether the two en-passant files (if present) have an opposing pawn, then we pick the amount of pawn free squares that are sandwiched between opposing white and black pawns, then we pick the actual locations of opposing pawn pairs, then we pick the locations of all remaining pawns (anywhere except in between opposing pawn pairs), then we
pick locations of unmoved rooks, then we pick the composition of the white army (how many pieces of each type), then we pick the composition of the black army, and finally we pick all the piece placements.