Block-a-Day #14. A demonstration of recursion using the Eight Queens Problem.
Crown icon created by April Yang from the Noun Project.
What I Learned: I knew this wan’t the most efficient way to solve the problem, but there’s nothing like having to wait 200ms between frames to impart some empathy for the travails of the machine. As is, it takes about three minutes to get to the first solution. Better approaches are described on the Wikipedia page.
What I’d Do With More Time: A speed toggle would be nice. Maybe draw some lines between “bad queens” to emphasize the difference between vertical and diagonal elimination.
Just what it sounds like. For fifteen days, I will make a D3.js v4 block every single day. Rules: