Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
if put(key) == lock: solution in Clear category for Keys and Locks by veky
def plot(strings):
return {i + j*1j for i, line in enumerate(strings.strip().splitlines())
for j, entry in enumerate(line) if entry == '#'}
def put(rel):
origin = min(rel, key=hash, default=0)
return {z - origin for z in rel}
def keys_and_locks(lock, key):
lock, key = put(plot(lock)), plot(key)
for turn in range(4):
if put(key) == lock: return True
key = {z * 1j for z in key}
return False
Sept. 14, 2018
Comments: