""" This example is a simple demonstration of a standard 'from_outputs'
call. It predicts the paths which will be generated by future pastes
to the fiche (https://github.com/solusipse/fiche/), program.
"""


from foresight.glibc import rand_r

SYMBOLS = "abcdefghijklmnopqrstuvwxyz0123456789"


def main():
    path_1 = input("First path:")
    path_2 = input("Second path:")
    paths = path_1 + path_2
    outputs = [SYMBOLS.index(letter) for letter in paths]

    gen = rand_r.from_outputs(outputs, output_modulus=len(SYMBOLS))
    print("Next path:", end="")
    for _ in range(4):
        print(SYMBOLS[next(gen)], end="")
    print()

if __name__ == "__main__":
    main()
