diff --git a/src/constants.py b/src/constants.py index 7b75d11..fe305da 100644 --- a/src/constants.py +++ b/src/constants.py @@ -1,5 +1,6 @@ from modules.wires import WiresModule from modules.button import ButtonModule +from modules.comp_wires import ComplicatedWiresModule from modules.password import PasswordModule modules = { diff --git a/src/modules/password.py b/src/modules/password.py index 49bf9f2..6bb0ac9 100644 --- a/src/modules/password.py +++ b/src/modules/password.py @@ -1,3 +1,6 @@ +from prompt_toolkit import prompt +from prompt_toolkit.completion import WordCompleter + class FoundCondition(Exception): pass @@ -60,7 +63,7 @@ class PasswordModule: default module execution location (hint, default module execution location is where __name__ == - "__main__" + "__main__") """ responses = [] @@ -71,5 +74,16 @@ class PasswordModule: obj = cls(responses) return obj.solve() + @classmethod + def interactive(cls, state, cmdline): + responses = [] + for i in range(5): + print("Enter {}th column of letters:".format(str(i + 1))) + response = [*prompt('password> ')] + responses.append(response) + + password = cls(responses) + print(password.solve()) + if __name__ == "__main__": print(PasswordModule.human_helper())