Solving Puzzles with Amb
14-Nov-2019 2003
Ever since an article about fibers, I was curious about an amb operator. There are multiple articles explaining both what it is and how to implement it: Roseta Code and Eric Kidd’s blog. There is even a gem with two different implementations. What’s left unclear to me, though was how to solve problems with amb.I believe that the easiest way to understand something is to build it yourself and then try to explain it to others and that’s exactly what I’m doing now :)Recently, I’ve solved a few classical problems using amb. The result turned out to be short, simple and declarative.
Solving Puzzles with Amb #ruby #rubydeveloper #rubyonrails #Solving #Puzzles https://rubyonrails.ba/link/solving-puzzles-with-amb