There are 200 ways of doing this (if you don't distinguish between the 2 bunnies when they're on the same tile, 420 if you do). If you merge together moves involving the same animal there are only 4 (with length 15). https://gist.github.com/wrbs/5824e9b17c55b5ad3d8467f93e12ed8... (svg graph of the 4)
I tried to fuzz this rather than use an exhaustive search. So random animals walk randomly. It gets stuck. So I added if no animal moves after 100 attempts, restart. But it seems to get stuck all the time. So it loops around mostly and eventually falls to the stuck position. I have to think about this, is the entropy such that you'll never practically escape by randomly walking? I feel like if I add more conditions it just becomes an exhaustive search with billions+ of times the extra calculations.
This can be a useful approach when you have a very large number of states (as long as you also don't revisit states). In this case, there are few enough states to just BFS the fastest way directly.
This puzzle is so cool because it revolves around casual graphs in classical planning problem! One can use heuristics based search to come up with optimal solutions. I really like this innovative approach to the design.
However, one edge from house to tree wasn't clear at first because, I thought of it as logical or while it was about logical and. Other than that, pretty awesome work!! Edit:: Scrolling down the comments someone seems to already implemented a graph search. That is pretty quick: https://news.ycombinator.com/item?id=32885309
I'd love to see the formulation for this problem written out in proper form that can be fed to a solver like MiniZinc or CPLEX or whatever type of solver can handle it.
It looks like Hakan K (has a super cool website where he solves all kinds of optimization problems for fun) was able to solve it using the Picat language in a very small amount of code with a solution (not sure if optimal):
Yeah the edge with two conditions was a little confusing;
(1) and (2) or (3) At bone to go up, at flower to go down [or the converse?] Was able to figure it out through experimentation, but the signage doesn't make it obvious.
Or just one label that says "Somebody on bone and flower."
This gives me the idea to make variations of this puzzle to play with my 5yo using pencil and paper. It would be a fun way to teach the difference between AND and OR. Plus I'll get to see the puzzles he comes up with, once he realizes he can make his own!
I made the same assumption and didn't even try putting the dog and rabbits together, but I completed the puzzle (at least I'm pretty sure I didn't overlap them, there was a lot of back and forth)
I find it amusing that this is driven by the particular visualisations of the characters. I.e. if it were a chicken and a rabbit would you have also made this assumption?
For me it's a variant of a classical "move a wolf, goat and cabbage across the river", where you can't have some of them on the boat together, because it would be eaten.
I had the same problem. I was trying to click on things but not drag. Maybe if one of the animals is clicked but not dragged, it could expand and immediately get small, as if it had been dragged 0 pixels?
Can you think of a way to re formulate the puzzle so that you can express the rules without words? Also, the dog / rabbit dynamic (as used in the classic dog/duck/grain river crossing puzzle) made me think that I had to chase the rabbits with dog, or that dogs and rabbits couldn’t share a node. Different animals might be better — rabbit and mouse, perhaps? Or even different coloured rabbits and different coloured carrots? The words thing though — that’s what you should work on next, I think. Good puzzles like this are word-free in the puzzle itself (Stephen’s sausage roll, English country tune). It would take this puzzle from great to excellent. Good luck. More please!
> Also, the dog / rabbit dynamic (as used in the classic dog/duck/grain river crossing puzzle) made me think that I had to chase the rabbits with dog, or that dogs and rabbits couldn’t share a node.
Yes, I assumed first that no two animals could share a node at all until I was near the end (and saw that it would be necessary), and I still assumed that rabbits and the dog couldn't share a node ("the dog will eat the rabbit!") because of the river crossing thing, until someone in this very comment thread mentioned an unsolvable state that involved getting the dog a rabbit on the same node.
FYI It's not necessary to solve the puzzle. Also it seems to have issues on FF/Linux because when I did stack a dog and a rabbit I could only then select the dog.
Comments (464) 216 threads
Earlier commentsThere are 200 ways of doing this (if you don't distinguish between the 2 bunnies when they're on the same tile, 420 if you do).
If you merge together moves involving the same animal there are only 4 (with length 15).
https://gist.github.com/wrbs/5824e9b17c55b5ad3d8467f93e12ed8... (svg graph of the 4)
I tried to fuzz this rather than use an exhaustive search.
So random animals walk randomly.
It gets stuck. So I added if no animal moves after 100 attempts, restart.
But it seems to get stuck all the time. So it loops around mostly and eventually falls to the stuck position.
I have to think about this, is the entropy such that you'll never practically escape by randomly walking?
I feel like if I add more conditions it just becomes an exhaustive search with billions+ of times the extra calculations.
Shame. Shame. Shame. rings bell
However, one edge from house to tree wasn't clear at first because, I thought of it as logical or while it was about logical and. Other than that, pretty awesome work!!
Edit:: Scrolling down the comments someone seems to already implemented a graph search. That is pretty quick: https://news.ycombinator.com/item?id=32885309
http://hakank.org/picat/dogbunny_puzzle.pi
His website is a treasure trove for these kinds of problems and worth studying.
Continue this thread — 3 replies
(1) and
(2) or
(3) At bone to go up, at flower to go down [or the converse?]
Was able to figure it out through experimentation, but the signage doesn't make it obvious.
This gives me the idea to make variations of this puzzle to play with my 5yo using pencil and paper. It would be a fun way to teach the difference between AND and OR.
Plus I'll get to see the puzzles he comes up with, once he realizes he can make his own!
It would be neat if the conditional statements emphasized and deemphasized based on whether their condition was currently met.
Continue this thread — 1 reply
Can you think of a way to re formulate the puzzle so that you can express the rules without words?
Also, the dog / rabbit dynamic (as used in the classic dog/duck/grain river crossing puzzle) made me think that I had to chase the rabbits with dog, or that dogs and rabbits couldn’t share a node. Different animals might be better — rabbit and mouse, perhaps? Or even different coloured rabbits and different coloured carrots?
The words thing though — that’s what you should work on next, I think. Good puzzles like this are word-free in the puzzle itself (Stephen’s sausage roll, English country tune).
It would take this puzzle from great to excellent. Good luck. More please!
Yes, I assumed first that no two animals could share a node at all until I was near the end (and saw that it would be necessary), and I still assumed that rabbits and the dog couldn't share a node ("the dog will eat the rabbit!") because of the river crossing thing, until someone in this very comment thread mentioned an unsolvable state that involved getting the dog a rabbit on the same node.
FYI It's not necessary to solve the puzzle.
Also it seems to have issues on FF/Linux because when I did stack a dog and a rabbit I could only then select the dog.
Continue this thread — 4 replies
I'm imagining Haskell with emojis now.
https://gist.github.com/Erk-/be3ef032d31734b6f835edd9a9685af...
Perhaps just a picture of the state icon (or one with a slash through it) and have it "light up" when the condition is satisfied.
All comments shown.
Couldn't load more comments. Check your connection and try again.