
Solving Riddles with Prolog and ES6 Generators (2014) - zephyrfalcon
https://curiosity-driven.org/prolog-interpreter
======
Waterluvian
Partly related but generators clicked for me when I heard them described as,
"instead of pushing data into a function, you're pulling results out of a
function."

I've been doing a lot of asyncio lately and just having a mental model of my
pipelines working by pulling results through them has been invaluable.

~~~
pault
But you're also pushing data back in. Generators are coroutines that can be
suspended and resumed, and the yield keyword is a mechanism for two way
communication between the routine and coroutine.

~~~
Waterluvian
True. The idea doesn't hold as well now that data can be passed into a
generator in Python. Ie. Now that there's coroutines.

------
slig
Shameless plug: I run a website with dozens of such puzzles that can be solved
online. If you're interested, google "zebra puzzles", should be the first
link.

~~~
seisvelas
I want to check it out but all of the Google results are for Einstein's
Riddle. What's the link?

~~~
cjallen88
It’s the same thing.

