def msfpattern(n):
    """msfpattern-like patterns"""
    def inc(alphas, indexes, i):
        indexes[i % 3] += 1
        if indexes[i % 3] >= len(alphas[i % 3]):
            indexes[i % 3] = 0
            inc(alphas, indexes, 1-i)
        return

    alphas = ["ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", "0123456789"]
    indexes = [0] * len(alphas)

    chars = []
    for i in range(n):
        chars.append(alphas[i % 3][indexes[i % 3]])
        if i % 3 == 2:
            inc(alphas, indexes, i)
    return "".join(chars)
dataset/ETHPy150Open Gallopsled/pwntools-write-ups/wargames/overthewire-vortex/level4/libformatstr/pattern.py/msfpattern/swapped operands of `-`