Created
November 28, 2017 15:47
-
-
Save austindoeswork/274b48e4a5dc709e564c440848a8828c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base = [] | |
for i in range(7): | |
base.append((-2)**i) | |
base = base[::-1] | |
values = [] | |
valueDict = {} | |
for x in range(2): | |
for x1 in range(2): | |
for x2 in range(2): | |
for x3 in range(2): | |
for x4 in range(2): | |
for x5 in range(2): | |
for x6 in range(2): | |
tup = (x,x1,x2,x3,x4,x5,x6) | |
val = base[0]*x + base[1]*x1 + base[2]*x2 +base[3]*x3 + base[4]*x4 + base[5]*x5 + base[6]*x6 | |
values.append(val) | |
valueDict[val] = tup | |
print sorted(set(values)) | |
for key in sorted(valueDict.iterkeys()): | |
print "%3s: %s" % (key, valueDict[key]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so extensible