From: Stefan Schmiedl Date: 2002-06-05T05:19:59+09:00 Subject: Re: Solving logic problems with Ruby On Tue, 04 Jun 2002 20:07:27 GMT, Victor Manuel Reyes Viloria wrote: > > 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 > Not that I venture a solution here, but you might also want to read Piers Anthony's "With a Tangled Skein", especially the last sections :-) s.