Skip to content

Instantly share code, notes, and snippets.

@isidentical
Created December 31, 2019 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isidentical/b893ab7d753c700f39446110b7d8a601 to your computer and use it in GitHub Desktop.
Save isidentical/b893ab7d753c700f39446110b7d8a601 to your computer and use it in GitHub Desktop.
L1 = dict.fromkeys("1 21 45 62 70".split())
L2 = dict.fromkeys("17 39 50 73 81".split())
L3 = dict.fromkeys("4 28 48 65 90".split())
LINES = (L1, L2, L3)
completed_lines = set()
while len(completed_lines) != 3:
num = input("Next > ")
for n, line in enumerate(LINES, 1):
if num in line:
line[num] = True
total_values = [value for value in line.values() if value]
print(f"Line {n}: {len(total_values)}/{len(line)}")
if n not in completed_lines and all(line.values()):
completed_lines.add(n)
print(f"Line {n} completed!")
print("You won!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment