diff --git a/src/namegeneration.py b/src/namegeneration.py new file mode 100644 index 0000000..959184e --- /dev/null +++ b/src/namegeneration.py @@ -0,0 +1,30 @@ +import string +from random import randint, choice + +vowels = set("aeiou") +consonants = set(string.ascii_lowercase) - vowels +names = set() + + +def f(w): + return "".join([choice(list(consonants)) if c else choice(list(vowels)) for c in w]) + + +for _ in range(int(input())): + s = randint(3, 20) + w = [] + for i in range(s): + if i < 2: + w.append(randint(0, 1)) + else: + if w[-1] == w[-2]: + w.append((w[-2] + 1) % 2) + else: + w.append(randint(0, 1)) + + name = f(w) + while name in names: + name = f(w) + names.add(name) + + print(name) diff --git a/src/zyxab.py b/src/zyxab.py new file mode 100644 index 0000000..98d85dc --- /dev/null +++ b/src/zyxab.py @@ -0,0 +1,9 @@ +n = int(input()) +names = [input() for _ in range(n)] +names = [n for n in names if len(set(n)) == len(n) and len(n) >= 5] +if names: + least = min(len(n) for n in names) + names = [n for n in names if len(n) == least] + print(max(names)) +else: + print("Neibb")