day20/puzzle1.py
def mirror(tile):
    """Mirror across the y-axis."""
    old = tile.split("\n")
    N = len(old)
    new = [["." for n in range(N)] for m in range(N)]

    for m, row in enumerate(old):
        for n, cell in enumerate(row):
            new[m][N-1-n] = cell

    new = "\n".join(["".join(row) for row in new])
    return new
Mirror across the y-axis.
Mirror across the y-axis.
Mirror across the y - axis .
def mirror(tile):
    old = tile.split("\n")
    N = len(old)
    new = [["." for n in range(N)] for m in range(N)]
    for m, row in enumerate(old):
        for n, cell in enumerate(row):
            new[m][N-1-n] = cell
    new = "\n".join(["".join(row) for row in new])
    return new
def mirror ( tile ) : old = tile . split ( "\n" ) N = len ( old ) new = [ [ "." for n in range ( N ) ] for m in range ( N ) ] for m , row in enumerate ( old ) : for n , cell in enumerate ( row ) : new [ m ] [ N - 1 - n ] = cell new = "\n" . join ( [ "" . join ( row ) for row in new ] ) return new
Mirror across the y-axis.
Mirror across the y - axis .
"""Mirror across the y-axis."""
tile