During my college days I experimented with a language called Prolog.
This language was suitable to solve logic problems.
Had anybody used Ruby to solve logic problems?

For example, a problem like the one below:

You have 12 bricks.  They look and feel exactly the same
but one is different than the other 11.  It is either slightly
heavier or slightly lighter.  Using a balance scale, find
the odd brick and tell whether it is lighter or heavier than
a normal brick.  Oh yes, I almost forgot to tell you.  You
can only use the scale 3 times.


Thank you