Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces significant changes to the allMaxBy function in perfect_player.cpp. The updated logic now prioritizes moves based on their expected outcomes, specifically focusing on "Win" ('W'), "Draw" ('D'), and "Loss" ('L') scenarios. Key changes include: - Added conditions to check the first character of the string returned by the toString method of each evaluated move. - The function now first looks for moves leading to a win ('W'). If any are found, only these moves are considered. - If no winning moves ('W') are found, the function then looks for draws ('D'). Only draw moves are considered in this case. - If neither winning nor drawing moves are found, the function defaults to considering loss ('L') moves. - The previous implementation based on comparing values has been retained under an else clause, ensuring backward compatibility when shuffling is not enabled. This enhancement aligns the move selection process more closely with strategic gameplay considerations, improving the PerfectPlayer's decision-making capabilities. Change-Id: Iad135da3856a0b5acc3a16c35e1c22dcfb5c21ed
- Loading branch information