Skip to content

Instantly share code, notes, and snippets.

@arpruss
Created January 10, 2021 19:44
Show Gist options
  • Save arpruss/ce80417f07131449252795051bf39717 to your computer and use it in GitHub Desktop.
Save arpruss/ce80417f07131449252795051bf39717 to your computer and use it in GitHub Desktop.
digits = """xxx
x.x
x.x
x.x
xxx
.x.
xx.
.x.
.x.
xxx
xxx
..x
.x.
x..
xxx
xxx
..x
.xx
..x
xxx
x.x
x.x
xxx
..x
..x
xxx
x..
xxx
..x
xxx
xxx
x..
xxx
x.x
xxx
xxx
..x
.x.
.x.
.x.
xxx
x.x
xxx
x.x
xxx
xxx
x.x
xxx
..x
xxx"""
lines = [l.replace("x","1").replace(".","0") for l in digits.split("\n")]
for i in range(10):
out = ""
for j in range(5):
out = "00" + lines[i*6+j] + out
print(i,int(out,2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment