def encode_sprite(sprite):
    channelA = []
    channelB = []
    for y in range(8):
        a = 0
        b = 0
        for x in range(8):
            pixel = sprite[y][x]
            bit = pow(2, x - 7)
            if pixel == 1:
                a = a | bit
            elif pixel == 2:
                b = b | bit
            elif pixel == 3:
                a = a | bit
                b = b | bit
        channelA.append(a)
        channelB.append(b)
    return channelA + channelB
dataset/ETHPy150Open gutomaia/pyNES/pynes/sprite.py/encode_sprite/swapped operands of `-`