Whose Zebra?



This is an applet that will solve logic problems. The GUI is a little shaky at present, sue me I wrote it in a week.

I wrote this for MacTech's Programmer's Challenge, and in blatant violation of the rules I wrote it in Java. It's slow, oh well. I believe it is correct however. If you have a set of clues that breaks it, please let me know and I'll try and fix it.

To enter clues, you can paste them into the clue window and click "Enter Clues". It doesn't handle bad clues too gracefully yet. Make sure and check the console window for errors it spits up. (e.g. all relations must be defined before they are used or else it chokes.)

Clicking "Next" will step you through the logic the machine is going through. Clicking "Solve" will tell it to go right to a solution.

I've tested it with the Challenge sample input and with Ernst Munter's Lewis Carrol clues. It seems to work for both of them.

For more information on the challenge go here

HAVE FUN

Here's a basic set of clues you can paste into the clue window:

American ISA person
Canadian ISA person
Australian ISA person
redDoor ISA house
greenDoor ISA house
blueDoor ISA house
dog ISA pet
cat ISA pet
zebra ISA pet
person lives_in house
person owns pet
American lives_in redDoor
blueDoor owns dog
cat IS_LOCATED IN_MIDDLE
greenDoor IMMED_RIGHT_OF blueDoor
SOLVE person owns zebra
ANSWER person house pet