# Copyright 2023 Theodore Somers
#This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation,
#either version 3 of the License, or (at your option) any later version.

#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
#without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

#You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

import random

def main():
    consonant_1 = "p"
    consonant_2 = "t"
    consonant_3 = "k"
    consonant_4 = "q"
    consonant_5 = "m"
    consonant_6 = "n"
    consonant_7 = "s"
    consonant_8 = "sh"
    consonant_9 = "h"
    consonant_10 = "l"
    consonant_11 = "r"
    consonant_12 = "rr"
    consonant_13 = "w"
    consonant_14 = "j"
    vowel_1 = "a"
    vowel_2 = "aa"
    vowel_3 = "e"
    vowel_4 = "ee"
    vowel_5 = "i"
    vowel_6 = "ii"
    vowel_7 = "o"
    vowel_8 = "oo"
    vowel_9 = "u"
    vowel_10 = "uu"
    vowel_11 = "ae"
    vowel_12 = "aee"
    vowel_13 = "eu"
    vowel_14 = "iu"
    vowel_15 = "io"
    vowel_16 = "in"
    vowel_17 = "iy"
    vowel_18 = "y"
    vowel_19 = "yy"
    vowel_20 = "oe"

    word_number = input("How many words do you want to create?")
    word_number = int(word_number)
    for i in range(word_number):
        syllable_count = random.randint(1, 4)
        if syllable_count == 1:
            syllable_num = [1]
        elif syllable_count == 2:
            syllable_num = [1, 2]
        elif syllable_count == 3:
            syllable_num = [1,2, 3]
        elif syllable_count == 4:
            syllable_num = [1, 2, 3, 4]
        elif syllable_count == 5:
            syllable_num = [1, 2, 3, 4, 5]
        elif syllable_count == 6:
            syllable_num = [1, 2, 3, 4, 5, 6]
        else:
            break
        for i in syllable_num:
            onset = random.randint(1, 14)
            # osound is onset sound and nsound is nucleus sound
            if onset == 1:
                osound = consonant_1
            elif onset == 2:
                 osound = consonant_2
            elif onset == 3:
                osound = consonant_3
            elif onset == 4:
                osound = consonant_4
            elif onset == 5:
                osound = consonant_5
            elif onset == 6:
                osound = consonant_6
            elif onset == 7:
                osound = consonant_7
            elif onset == 8:
                osound = consonant_8
            elif onset == 9:
                osound = consonant_9
            elif onset == 10:
                osound = consonant_10
            elif onset == 11:
                osound = consonant_11
            elif onset == 12:
                osound = consonant_12
            elif onset == 13:
                osound = consonant_13
            elif onset == 14:
                osound = consonant_14
            else:
                break
            nucleus = random.randint(1, 20)
            if nucleus == 1:
                nsound = vowel_1
            elif nucleus == 2:
                nsound = vowel_2
            elif nucleus == 3:
                nsound = vowel_3
            elif nucleus == 4:
                nsound = vowel_4
            elif nucleus == 5:
                nsound = vowel_5
            elif nucleus == 6:
                nsound = vowel_6
            elif nucleus == 7:
                nsound = vowel_7
            elif nucleus == 8:
                nsound = vowel_8
            elif nucleus == 9:
                nsound = vowel_9
            elif nucleus == 10:
                nsound = vowel_10
            elif nucleus == 11:
                nsound = vowel_11
            elif nucleus == 12:
                nsound = vowel_12
            elif nucleus == 13:
                nsound = vowel_13
            elif nucleus == 14:
                nsound = vowel_14
            elif nucleus == 15:
                nsound = vowel_15
            elif nucleus == 16:
                nsound = vowel_16
            elif nucleus == 17:
                nsound = vowel_17
            elif nucleus == 18:
                nsound = vowel_18
            elif nucleus == 19:
                nsound = vowel_19
            elif nucleus == 20:
                nsound = vowel_20
            else:
                break
            coda = random.randint(1, 8)
            if coda == 2:
                csound = consonant_5
                syllable = osound + nsound + csound
            elif coda == 6:
                csound = consonant_6
                syllable = osound + nsound + csound
            elif coda == 7:
                csound = consonant_7
                syllable = osound + nsound + csound
            else:
                syllable = osound + nsound
            if i == 1:
                word = syllable
            else:
                word = word + syllable
        print(word)

main()
