From: Victor Manuel Reyes Viloria Date: 2002-06-05T05:37:36+09:00 Subject: Re: Solving logic problems with Ruby Well, judging from the description of this book: Book Description When the man Niobe loved was shot, she learned that she had been the target, in a devious plot of the Devil's. Hoping for revenge, she discovered, too late, how intricate his scheming was, and that he had managed to trap her son and her granddaughter, Luna. Niobe's only chance to save them was to accept a challenge by the Prince of Deceit--a challenge to be decided in Hell and in a maze of Satan's devising! I am not sure how much it goes into logic. However, the book appears to be fascinating and I just ordered it from Amazon. The reviewers also gave it high marks. Thank you. Victor |---------+----------------------------> | | Stefan Schmiedl | | | | | | | | | 06/04/2002 04:19 | | | PM | | | Please respond to| | | ruby-talk | | | | |---------+----------------------------> >---------------------------------------------------------------------------------------------------------------------------------------------| | | | To: ruby-talk@ruby-lang.org (ruby-talk ML) | | cc: | | 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.