Esempio n. 1
0
    for i, l in enumerate(tries):
        ok, near = tests[i]
        res = ["\u25cf"] * ok + ["\u25d0"] * near + ["\u25cb"] * (len(game.target) - ok - near)
        line = "  ".join(res) + "    -    " + "  ".join([colored("\u25cf", color_names[it]) for it in l])
        print(line)
        print("")

    print("")
    print("")
    print("")

    print("                                      Available colors: " + "  ".join(colors))

    if game.success:
        print(f"Game won in {game.try_count} moves")
        break

    t = input("Your move: ")
    if not game.is_legal_raw_input(t):
        continue

    t = list(t)
    tries = [t] + tries
    tests = [game.test(t)] + tests