(71B) PUZZLER - The Program that Thinx
|
07-28-2015, 04:22 AM
(This post was last modified: 06-15-2017 01:37 PM by Gene.)
Post: #1
|
|||
|
|||
(71B) PUZZLER - The Program that Thinx
[Copied and de-typo'd from HPX Exchange, V1 N4 (Jul 87 - Mar 88), page 6. -jkh-]
According to INSIGHT magazine, the only way we can program artificial intelligence is with a parallel-processing mainframe like The Connection Machine. Not even a Cray can hack it, they said. What would they say about a handheld that thinx? Imagine your HP-71 solving the following puzzler, given only the English clues: Billy, Willy, Gerald and Oliver live (not respectively) in a Blue house, White house, Green house and Orange house, and have as pets (not respectively) a Bear, Walrus, Giraffe and Orangutan. The Clues: (1) Nobody's name, house color, or pet, begin with the same letter. (2) Billy never saw the walrus that lives in the green house. (3) Gerald never saw the bear. Who lives where with what pet? This type of "logic puzzle" is designed to exercise the mind and be a pleasant way to kill some time. Solving them on a machine that does all the thinking for you is certainly missing the point! But then, many crossword puzzle addicts use electronic dictionaries to help with their puzzles. So why not? The program listed below, called PUZZLER, solves any logic puzzle similar to the Billy, Willy, Gerald and Oliver puzzle above. It even solves the famous "Who Owns the Zebra?" puzzle. PUZZLER — HP-71B BASIC — 1768 bytes Code: 1 ! PUZZLER ! The Program that Thinx ! Joseph K. Horn ! Oct 1987 RUN PUZZLER and input the number of groups and the number of items per group. In the Billy, Willy, Gerald and Oliver puzzle, there are three groups (men, houses, pets) and four items per group (B, W, G, O). PUZZLER will ask if you prefer Auto or Quick processing. Auto mode means that PUZZLER thinks about every input after each one is typed in. This mode gives the impression of artificial intelligence the best; it seems to be thinking all the time. Quick mode means that PUZZLER lets you input the clues quickly, and then type THINK to force it to "think" about the clues. This mode is practical when there is a large number of groups and items. Then input names for every item, as indicated. If you wish, you may use the spreadsheet-style names that are automatically supplied; or type your own names over them. We'll use BILLY, WILLY, GERALD, OLIVER, BLUE, WHITE, GREEN, ORANGE, BEAR, WALRUS, GIRAFFE and ORANGUTAN as our inputs for the sample puzzle. Then input the clues. You can usually type the clues in English directly, but sometimes you must do a little simplification so that PUZZLER won't get puzzled. You must use the names that you supplied. PUZZLER looks for only logical "connections" or "disconnections". The following are all equivalent statements: BILLY NEVER SAW THE WALRUS BILLY DOESN'T OWN THE WALRUS BILLY DOES NOT OWN THE WALRUS BILLY NOT WALRUS BILLY - WALRUS And these are all equivalent: THE WALRUS LIVES IN THE GREEN HOUSE THE WALRUS IS IN THE GREEN HOUSE WALRUS IS GREEN WALRUS + GREEN WALRUS GREEN Of course, we must input the "not respectively" clues: BILLY - BLUE, BILLY - BEAR, BEAR - BLUE, WILLY - WHITE, etc. Keep inputting clues until PUZZLER discovers the answer and prints it out. Whenever PUZZLER discovers a logical connection or disconnection on its own, it prints it. If you don't have a video connected, or a printer acting as a video (DISPLAY IS PRINTER), then you'd better set the DELAY to something long enough to be useful, or change the program to pause after each display. If you wish to examine the known relationships between two items, input them with a "?" between, like this: BILLY ? BEAR This will result in all the relations between all the items in those two groups to be listed. This is useful when you are solving a puzzle with clues like "The Englishman lives next door to the man who smokes Chesterfields." The answer to the Billy puzzle is... well, I'll let you and your HP-71 figure it out. Artificial intelligence? No, not really, but it IS intriguing. For your entertainment, here's the puzzle that started this craze. Quote:Who Owns The Zebra? The "Who Owns the Zebra?" puzzle was first published in Life International Magazine on December 17, 1962. The version above is the original version. <0|ɸ|0> -Joe- |
|||
07-29-2015, 03:59 AM
(This post was last modified: 07-29-2015 04:24 AM by Jim Horn.)
Post: #2
|
|||
|
|||
RE: (71B) PUZZLER - The Program that Thinx
Good Heavens, Joe, does that bring back memories - of a fairly newly minted USAF Second Lieutenant visiting his high-school brother in the exotic and far away lands of Orange County in 1976... I'm still amazed at how you immediately understood my poorly-illustrated description of how to solve problems like these using a matrix drawn on paper. That you had a program to do it so well in BASIC in short order - well, no wonder you ended up hearing from as far away as Australia about it.
Great work! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)