a problem to solve

John Salerno johnjsal at NOSPAMgmail.com
Sat Mar 25 08:19:52 CET 2006

mensanator at aol.com wrote:

> If you need help in figuring out how to walk through all 4096 possible
> switch sets, just ask.

Ok, thanks to your list, I figured out a program that works! It's 
probably not the best, and it doesn't really display which switches are 
correct in any apparent way (you have to look for them in the list), but 
it works! Here's the code. I'd love to see your implementation too.

from gmpy import digits

panelOne = [0xf5fdc,0xf6edb,0xbddb7,0x6fddd,0xeb7ed,0xb977f,0xbfed3,0xedef5]
panelTwo = [0xddb7d,0xfaddb,0xde75f,0xeef7a,0xdd77b,0xdfbce,0xb77dd,0x7ef5d]
panelThree = 
panelFour = 

for a in panelOne:
	for b in panelTwo:
		for c in panelThree:
			for d in panelFour:
				if (a & b & (c ^ d)) | (c & d & (a ^ b)) == 1048575:
					print 'Solution is:', digits(a, 16), digits(b, 16), digits(c, 16), 
digits(d, 16)

More information about the Python-list mailing list