Skip to content

Instantly share code, notes, and snippets.

@lyxal

lyxal/cringe.py Secret

Created December 5, 2020 05:31
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 lyxal/da38558c80d395ddc1273cbe13a46a6f to your computer and use it in GitHub Desktop.
Save lyxal/da38558c80d395ddc1273cbe13a46a6f to your computer and use it in GitHub Desktop.
from itertools import *
from string import *
from math import *
i = open("input.txt").read().split("\n")
row_up = 128
row_low = 1
col_up = 8
col_low = 1
ids = []
for l in i:
for c in l:
if c == "F":
row_up /= 2
if c == "B":
row_low *= 2
if c == "L":
col_low *= 2
if c == "R":
col_up /= 2
ids.append(((row_up+row_down)/2)*8 + (col_up + col_down)/2)
print(max(ids))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment