This commit is contained in:
BarsTiger
2021-04-23 13:06:38 +03:00
parent 1fc46a4779
commit f98a6be342
25 changed files with 855 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
import time, sys
name1 = []
name2 = []
flames = ["F lame", "f L ame", "fl A me", "flam E"]
flame = ["f", "l", "a", "m", "e"]
biglettersflame = {"f": "", "l": "", "a": "", "m": "", "e": ""}
biglettersflame2 = {"f": "F", "l": "L", "a": "A", "m": "M", "e": "E"}
def printinator(spisok, probeli):
slovo = ""
if probeli == True:
for bukva in spisok:
slovo = slovo + bukva
slovo = slovo + " "
else:
for bukva in spisok:
slovo = slovo + bukva
print(slovo)
def comparator():
for o in name1:
while o in name2:
name2.remove(o)
printinator(name2, False)
while o in name1:
name1.remove(o)
printinator(name1, False)
for o in name2:
while o in name1:
name1.remove(o)
printinator(name1, False)
while o in name2:
name2.remove(o)
printinator(name2, False)
def printflame(index):
slovo = ""
for o in range(len(flame)):
if o != index - 1:
slovo = slovo + flame[o]
else:
slovo = slovo + biglettersflame[flame[o]]
print('\b' * 10, end='')
print(format(slovo), end='')
sys.stdout.flush()
name1str = input("Enter name of first person (all letters should be small): ")
name2str = input("Enter name of second person (all letters should be small): ")
for letter in name1str:
name1.append(letter)
printinator(name1, False)
for letter in name2str:
name2.append(letter)
printinator(name2, False)
print("")
print("Deleting letters, that both names contain")
comparator()
print("")
print("Now we have:")
printinator(name1, False)
printinator(name2, False)
dlina = len(name1) + len(name2)
print("Lengths of two names is: " + str(dlina))
print("Now check:")
printinator(flame, False)
print("")
i = -1
j = -1
peredudaleniemi = 0
while len(flame) > 1:
while j < dlina:
i = i + 1
j = j + 1
if i > len(flame):
i = -1
printflame(i)
time.sleep(0.4)
if len(flame) > 1:
if dlina <= len(flame):
del flame[dlina - 1]
else:
del flame[(dlina % len(flame)) - 1]
j = 0
i = 0
print('\b' * 10, end='')
print(flame[0])
print("")
print("Your prediction letter is: " + biglettersflame2[flame[0]])
print("You can interpret it differently, because it is prediction")
input("To exit press Enter...")