In article <[EMAIL PROTECTED]>, John Salerno <[EMAIL PROTECTED]> wrote: >bruno at modulix wrote: > >> Now if I may ask: what is your actual problem ? > >Ok, since you're so curious. :) > >Here's a scan of the page from the puzzle book: >http://johnjsalerno.com/spies.png > >Basically I'm reading this book to give me little things to try out in >Python. There's no guarantee that this puzzle is even conducive to (or >worthy of) a programming solution.
Exhaustive search is quite practical for this problem: [(x,y,z,w) for x in (True, False) for y in (True, False) for z in (True, False) for w in (True, False) if spy(x,y,x,w)] Given the appropriate spy() function, this will return a set of values for the truthful (logically coherent) spy and nothing for the other spy. The details are left as an exercise for the reader. :-) Gary Duzan Motorola CHS -- http://mail.python.org/mailman/listinfo/python-list