diff --git a/projektkck.py b/projektkck.py index 288ade2..9837a56 100644 --- a/projektkck.py +++ b/projektkck.py @@ -1,13 +1,13 @@ -dotsfile = open('dots.txt', 'r+') -wantedfile = open('wanted.txt', 'r+') +dotsfile = open('dots.txt', 'r') +wantedfile = open('wanted.txt', 'r') -def commandToArray(sentence): - print(sentence) +def commandStrip(sentence): for line in dotsfile: line=line.strip('\n') sentence = sentence.replace(line, "") - print(sentence) + return sentence +def searchKeyWords(sentence): found = [] for line in wantedfile: line=line.strip('\n') @@ -18,10 +18,10 @@ def commandToArray(sentence): return found return 1 -def arrayToShit(array): - print("I have found words: " + " ".join(array)) - return 0 +temp = commandStrip("Guten tag, ich want you to pick up big red triangle.") +temp = searchKeyWords(temp) +if temp!=1: + print("I have found words: " + " ".join(temp)) -array = commandToArray("HEHEHEHHEHEHEHEHELLO, I want you to give me an eye!?!!") -if array!=1: - arrayToShit(array) +dotsfile.close() +wantedfile.close() \ No newline at end of file