Last active
September 3, 2024 20:22
-
-
Save leonid-shevtsov/6ed346b5d73a681ffd49eb74ec27272b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The goal: swap White and Black knights: | |
+-+ | |
A |W| | |
+-+-+ | |
B | | | | |
+-+-+-+ | |
C | |W| | | |
+-+-+-+-+ | |
D |B| |B| | | |
+-+-+-+-+ | |
1 2 3 4 | |
The way is clear if you turn the board into a graph: | |
W W B | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| | |
D3 B | |
The possible moves make a chain, | |
with only one appendix that will be used to swap piceces. | |
-> W W B | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| | |
D3 B | |
B <- W W B | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| ^ | |
D3 | | |
B W W <- | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| V | |
D3 B | |
B -> W W | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| | |
D3 B | |
B B <- W W | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| ^ | |
D3 | | |
B B W <- | |
A2 - C3 - D1 - B2 - C4 - D2 - B3 - D4 - C2 | |
| V | |
D3 W |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment