add minor optimization where yellow is excluded from specific position

This commit is contained in:
randomuser 2022-02-07 13:52:15 -06:00
parent ee3611110a
commit e4aaff1f0b
1 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,7 @@ while True:
nocontain.append(i[1]) nocontain.append(i[1])
print("\033[47;97m {} ".format(i[1]), end="") print("\033[47;97m {} ".format(i[1]), end="")
elif i[0] == "y": elif i[0] == "y":
contains.append(i[1]) contains.append((i[1], count))
print("\033[103;97m {} ".format(i[1]), end="") print("\033[103;97m {} ".format(i[1]), end="")
elif i[0] == "g": elif i[0] == "g":
defcontains.append((i[1], count)) defcontains.append((i[1], count))
@ -37,17 +37,21 @@ while True:
req = [item[0] for item in defcontains if item[1] == counter][0] req = [item[0] for item in defcontains if item[1] == counter][0]
except: except:
req = None req = None
nothere = [item[0] for item in contains if item[1] == counter]
if req != None: if req != None:
if req == j: if req == j:
counter += 1 counter += 1
continue continue
else: else:
status = 0 status = 0
for k in nothere:
if k == j:
status = 0
if j in nocontain: if j in nocontain:
status = 0 status = 0
counter += 1 counter += 1
for j in contains: for j in contains:
if not j in i: if not j[0] in i:
status = 0 status = 0
if status == 1: if status == 1:
buf.append(i) buf.append(i)