TypeScript and crossing the river
Have you ever heard of that puzzle where a farmer wants to cross a river with a fox, a goose, and a bag of beans? He has a boat, but he can only fit himself in the boat plus at most one of the three items he bought: the fox, the goose, or the bag of beans. (Don't ask me why he bought a fox. I have no idea. Probably an impulse purchase.)
The fox really wants to eat the goose, and will at the first opportunity when it's left alone with it. Similarly, the goose is eyeing the bag of beans, and will gobble it up if unsupervised, even though it has promised to give up beans for lent. If anyone eats anything, the farmer loses and you don't solve the puzzle. The goal is to take all three items across the river unscathed.
It's a cute puzzle, and there are two solutions — neither is too hard to find. But one day I thought, hey, why not write a program that searches for a solution? You feed it the rules of the puzzle, and it just comes up with a way to take the items across. Like magic! You can input various other puzzles too, and it'll solve them too.