We need to input the coordinates in the chess format and turn it to number and then check for every coordinate the knight can strike.
This is the list of all the corresponding coordinates needed to add to the current coordinate to get to a cell which a knight can strike.
1, 1, 2, 2,-1,-1,-2,-2
2,-2, 1,-1, 2,-2, 1,-1
This is the list of all the corresponding coordinates needed to add to the current coordinate to get to a cell which a knight can strike.
1, 1, 2, 2,-1,-1,-2,-2
2,-2, 1,-1, 2,-2, 1,-1
No comments:
Post a Comment