News for hackers. Stuff that matters.
Re:Ain't It Funny How the Knight Moves? by mckeed on Friday January 20, 2023 @08:33PM (#34462822)
I mapped out the structure of the board as a graph of which squares you can get to from which other squares. It's surprisingly stringy without all the squares forbidden by the queen placement.

https://i.imgur.com/8OuQcu8.png

Re:Ain't It Funny How the Knight Moves? by hot_gril on Friday January 20, 2023 @08:46PM (#34462905)
Was hoping someone had done this already, thanks.
Re:Ain't It Funny How the Knight Moves? by mckeed on Friday January 20, 2023 @08:53PM (#34462950)
Interestingly, you can hit all of the top 3 rows without going below the queen except for needing g4 to get to and from h6.
Re:Ain't It Funny How the Knight Moves? by jonas-w on Friday January 20, 2023 @09:10PM (#34463096)
How did you do this? Or was this done manually?
Re:Ain't It Funny How the Knight Moves? by mckeed on Friday January 20, 2023 @10:01PM (#34463422)
I wrote a ruby script to map out the graph and fed it into graphviz to make the image.

https://graphviz.org

Re:Ain't It Funny How the Knight Moves? by maxcan on Friday January 20, 2023 @10:13PM (#34463496)
This is the way.
Re:Ain't It Funny How the Knight Moves? by dfan on Friday January 20, 2023 @10:40PM (#34463643)
This is a good advertisement for the approach I came up with eventually: if you don't see a trivial way to the next square, find a sequence that will lead to it that starts in the lower right quadrant, then go to that quadrant and get to that square. (The lower right quadrant is the center ring in this diagram.)

I'm used to a version with pawns that involves less backtracking, so it took me a little while to stop trying to be "smarter" and just be okay with continually returning to home base.

Re:Ain't It Funny How the Knight Moves? by v64 on Saturday January 21, 2023 @12:40AM (#34464202)
Thanks for generating this! I struggled quite a bit getting to a few squares, and the graph shows they were indeed far apart from each other and that I wasn't missing something obvious.
Re:Ain't It Funny How the Knight Moves? by graphenjoyer on Saturday January 21, 2023 @12:52AM (#34464240)
Same but with the original board as part of the visualization, and with different parts of the structure highlighted:

https://ibb.co/JFY3jm4

It made a lot more sense after doing that, as I'm nowhere near proficient enough at chess to see the board and all its moves in my mind's eye.

Re:Ain't It Funny How the Knight Moves? by capitol_ on Saturday January 21, 2023 @02:35AM (#34464648)
That was a very good visualization of the problem/solutions, thanks :)
Re:Ain't It Funny How the Knight Moves? by k0k0r0 on Saturday January 21, 2023 @06:10AM (#34465615)
Wow, this vizualization is amazing!
Re:Ain't It Funny How the Knight Moves? by JoeyPriceless on Saturday January 21, 2023 @06:43AM (#34465748)
Really living up to your username!
Re:Ain't It Funny How the Knight Moves? by Terretta on Saturday January 21, 2023 @12:58PM (#34468461)
Almost like they were born to do this.
Re:Ain't It Funny How the Knight Moves? by unflxw on Saturday January 21, 2023 @10:02AM (#34466848)
Hah, you beat me to it! I drew this very same board by hand, after noticing that many positions were dead ends, and that the options for moving around the top-left were quite limited.

Based on the graph, I also found an optimal route through the whole board: https://gist.github.com/unflxw/b4d21c55c137a9a42fba75bd0cf98...

Re:Ain't It Funny How the Knight Moves? by cyclotron3k on Saturday January 21, 2023 @02:32AM (#34464638)
I'm not sure what I was expecting but 8t wasn't that. Very interesting!