99 Prolog Problems in Ruby
April 12th, 2009
I spent the weekend on the shores of Lake Huron. During the kids’ naps, I worked through the first 28 problems of P-99: Ninety-Nine Prolog Problems in Ruby. Many have done it before me (in many languages and variations). Many will do it after.
So far P27 gave me the most trouble because I refused to use my brain. Figured it out on a nice long walk with the family. P28 was a pain because I was figuring out how Ruby blocks/procs work. Here’s the code.
p.s. an immutable list, like in Scala (or Lisp, etc, etc), with pattern matching of course, would be handy in Ruby. I wonder if one exists…