Idea for a small work/puzzle

We all know the wolf/goat/cabbage puzzle, (fox/hen/grain) but I stumbled across this which might be a good programming exercise and give a good chunk of story.

mentalfloss.com/article/88284/ca … ing-puzzle

It’s interesting to prove why you can’t do it in what seems like the minimum of 9, if you want, but it’s also a neat logic puzzle that loops over the probably overused puzzle. (though ifdb.tads.org/viewgame?id=disk8jhpff89uh4s Dragon Flies Like Laborite was well received!)

Just thought I’d throw it out there, for anyone who might be able to do something with it. It looks like it could work with parser or choice, and it’d be beyond the usual hello world-ish stuff.

Implementing the scenario as a puzzle seems doable. It’s the player who would have to solve the puzzle, so the only thing the interpreter must do is check the conditions after each turn and react: if on either side of the river there are more lions than wildebeest then lions eat wildebeast. The challenge here may be handling multiple identical objects. If the player refers to “a” wildebeest, which one should react? E.g. if one is in the raft and 2 are on the shore the command “lead wildebeest to raft” should not result in “The wildebeest is already in the raft”. But this seems doable as well.

Implementing the algorithm to solve the problem is a different story. This would result in the scenario that 6 NPCs (3 wildebeast and 3 lions) would have to work together and negotioate on how they all can get safely to the other side of the river, given the constraints. If implemented correctly, it would then also work with 8, 10, … That’s a challenge to implement, I think.

Yeah, I think Inform handles multiple objects of the same type pretty well. But again it might be easier to use Twine e.g.

You are on the raft on the west side. The raft contains (clickable link to lion if there) and (clickable link to wildebeest if there, both of which drop the lion/wildebeest off). The west site has (clickable link to lion if there) and (clickable link to wildebeest if there, both of which put the lion/wildebeest on the raft).

CLICK HERE to go back east.

Or in Inform we could just have variables beast-west beast-raft, beast-east, lion-west, lion-raft, lion-east and treat the wildebeest/lion as scenery in Inform.

Implementing the algorithm to solve the problem is a different story. This would result in the scenario that 6 NPCs (3 wildebeast and 3 lions) would have to work together and negotioate on how they all can get safely to the other side of the river, given the constraints. If implemented correctly, it would than also work with 8, 10, … That’s a challenge to implement, I think.
[/quote]

This is just a politically correct rephrasing of the missionaries and cannibals problem, isn’t it?
(Which came in two versions: avoid the missionaries being eaten, or avoid the cannibals being converted.)

LOL