Solving a wooden puzzle using Haskell
Link: https://glocq.github.io/en/blog/20250428/
Discussion: https://news.ycombinator.com/item?id=45272022
Solving a wooden puzzle using Haskell
Link: https://glocq.github.io/en/blog/20250428/
Discussion: https://news.ycombinator.com/item?id=45272022
Thanks for the great blog post.
I played around with it and I think I found a way to reduce computing time?
I answered to the discussions:
https://news.ycombinator.com/item?id=45272022#45330908
Hi @mdrslmr , thanks for your interest, I was happy to see a discussion on hacker news. Sadly I don't have an account there so I can't answer the comments there, so thank you for commenting here as well.
I have many questions, because I'm not sure I understand your suggestion 😅 What is the reasoning behind your `exclude` function exactly? Is it supposed to detect when two pieces' trunks are adjacent to each other? But then are you assuming that if two pieces touch in that way, they are not compatible? If so, why?
@mdrslmr Ah, I see, since the goal is to find a solution, any additional constraint is valid as long as you still get one or more solutions.
Well then, if you still found a solution, good job! I still don't grasp intuitively why that constraint would hold, but in practice, if I remember well, the solution that my original algorithm came up with did respect the constraint you added. So your intuition must have been good!
Hi, I tried to print the solution in a different way, see:
https://github.com/mdrslmr/wooden_map/tree/main
The code is ugly, I know, but it works.
The funny thing is: a friend of mine had the almost the same puzzle at home and he gave it to me. But he had instructions attached. And it has an additional challenge using black and white like a chess board in 3d.
Right, Thanks. I added the output to the READNE,
I learned, my first attempt to exclude pieces, was rather bad luck, so I removed that idea from the code.
For practicing haskell I supplemented the code to run in parallel. Additionally I added some basic analysis to check if solutions are really different and how much solutions are symmetry rotations or reflections of each other. I pushed the code here (courtesy glocq):
https://github.com/mdrslmr/wpp