File indexing completed on 2024-11-27 03:17:55
0001
0002
0003
0004 entries = []
0005 for a in [1,0]:
0006 for b in [1,0]:
0007 for c in [1,0]:
0008 for d in [1,0]:
0009 for e in [1,0]:
0010 for f in [1,0]:
0011 entry = (a,b,c,d,e,f)
0012 entries.append(entry)
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 results = []
0028 for entry in entries:
0029 (a,b,c,d,e,f) = entry
0030
0031
0032 if a and b and c and d and e and f:
0033 vmask = (1,1,1,1)
0034
0035
0036 elif a and b and d:
0037 vmask = (1,1,1,0)
0038
0039
0040 elif a and f and e:
0041 vmask = (1,1,0,1)
0042
0043
0044 elif d and c and e:
0045 vmask = (1,0,1,1)
0046
0047
0048 elif b and c and f:
0049 vmask = (0,1,1,1)
0050
0051
0052 elif a:
0053 vmask = (1,1,0,0)
0054
0055
0056 elif d:
0057 vmask = (1,0,1,0)
0058
0059
0060 elif e:
0061 vmask = (1,0,0,1)
0062
0063
0064 elif b:
0065 vmask = (0,1,1,0)
0066
0067
0068 elif f:
0069 vmask = (0,1,0,1)
0070
0071
0072 elif c:
0073 vmask = (0,0,1,1)
0074
0075
0076 else:
0077 vmask = (0,0,0,0)
0078
0079 results.append(vmask)
0080
0081
0082
0083
0084 for result in results:
0085 (w,x,y,z) = result
0086 print("%i%i%i%i" % (z,y,x,w))
0087
0088
0089 generate_cpp_array = False
0090 if generate_cpp_array:
0091 linebreak = "\n "
0092 sep = ", "
0093 s = "static const int trk_bld[64] = {"
0094 s += linebreak
0095 i = 0
0096 for result in results:
0097 (w,x,y,z) = result
0098 s += "0b%i%i%i%i" % (z,y,x,w)
0099 if i != 63: s += sep
0100 if i%8 == 7 and i != 63: s += linebreak
0101 i += 1
0102 s += "\n};"
0103 print(s)