You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a board representation that 12x12 to detect when moves are outside the board. The 8x8 actual board sits in the middle. When generating moves step-by-step, the border around the board allows for detection of moves that exit the board without needing if statements based on rank and file calculations. A two-square border is needed for keeping knight moves on the board. This should simplify the below code.
Another important improvement is that Square_Difference only requires a single int to specify the move (the square index difference). The linear algebra operations on Square_Difference (are_parallel(), same_direction()) will need some thought.
A 10x12 board with 4 extended ranks and 2 extended files is sufficient because a knight jumping horizontally off the board from the edge will always end on an index that is too large (either through wrapping a negative value off the a-file or landing on a too large index off the h-file.
Use a board representation that 12x12 to detect when moves are outside the board. The 8x8 actual board sits in the middle. When generating moves step-by-step, the border around the board allows for detection of moves that exit the board without needing
if
statements based on rank and file calculations. A two-square border is needed for keeping knight moves on the board. This should simplify the below code.Genetic_Chess/src/Game/Square.cpp
Lines 82 to 94 in a637126
The text was updated successfully, but these errors were encountered: