Skip to content

Instantly share code, notes, and snippets.

def get_moves(status):
pos, _ = status
row, col = pos // 4, pos % 4
if row > 0: yield "U"
if row < 3: yield "D"
if col > 0: yield "L"
if col < 3: yield "R"
def copy_bit(v, b1, b2):
if v & (1 << b1):