print("This game inserts syllables in front of the vowels of a word. You are allowed to pick two syllables and the word to insert these syllables into.") print("The game will insert your first chosen syllable in front of the first vowel of your word and the second vowel in front of the remaining vowels of the word.") print("Therefore, the first syllable will only be inserted into the word once and the second syllable inserted every other time.To better explain the rest of the game") print("we will choose two example syllables and a word for you. The first syllable will be (ib) , the second syllable will be (ag) , and the word will be (program).") print("Therefore with what he have explained thus far our translated word would be (pribogragam). There are a few more tricks to the game though.") print("First, if the word has two vowels in a row then it will only insert a syllable in front of the first vowel and skip over the next vowel doing nothing") print("until a consonant has appeared again. For example, we will switch our chosen word to (weirdo). The translated word would then look like this (wibeirdago)") print("not inserting anything before the (i) in (weirdo)") print("Second, another trick thrown into the game is the wildcard symbol (*). If you put the wildcard symbol in front of your chosen syllables.") print("Then the syllable will replace the (*) With the vowel of the word that the syllable is being placed in front of and add the rest of your syllable along with it.") print("For example if we use chosen syllable (*b) and (*g) for the chosen word (weirdo). Then your translated word would look like this (webeirdogo).") print("The (*b) became eb since being inserted in front of the vowel 'e' and the (*g) became (og) because it was inserted in front of the vowel 'o'.") print("Remember (*g) wasn't inserted in front of i because 'ei' in (weirdo) are two vowels in a row so the game skips over it until the next consonant,'r',") print("which then it finds the next vowel,'o' and inserts the second syllable in front of the 'o'.") print("The goal of this game is to have fun! Thanks for playing!!") import string punctuation = '*' vowels = 'aeiouAEIOU' replay = 'y' answer ='yYnN' n_ans = 'nN' y_ans = 'yY' while replay in y_ans: syl = input("Please enter your first Gibberish syllable(adding * causes a vowel substitution):") syl_2 = input("Please enter your second Gibberish syllable(* for vowel substitution):") s = input("Please enter a word to be translated:") while(syl.isdigit() or syl_2.isdigit()or s.isdigit()): print("must enter only letters or wildcard(*) for the syllables") syl = input("Please enter your first Gibberish syllable(adding $ causes a vowel substitution):") syl_2 = input("Please enter your second Gibberish syllable($ for vowel substitution):") s = input("Please enter a word to be translated:") copy = '' p_ch = 'd' v_ch = 'd' z = '*' for i,ch in enumerate(s): if ch in vowels and p_ch not in vowels and v_ch not in vowels and punctuation not in syl: x = s.replace(s,syl+ch) copy = copy+x p_ch = ch v_ch = ch z = ch elif p_ch in vowels: copy = copy + ch p_ch = ch elif v_ch in vowels and ch in vowels and punctuation in syl_2: syl_s2 = ch +syl_2[1:] x = s.replace(s,syl_s2+ch) copy = copy+x p_ch = ch elif ch in vowels and v_ch in vowels and punctuation not in syl_2: x = s.replace(s,syl_2+ch) copy = copy+x p_ch = ch elif punctuation in syl and ch in vowels: syl_s = ch + syl[1:] x = s.replace(s,syl_s+ch) copy = copy+x p_ch = ch v_ch = ch else: copy =copy+ch p_ch = ch print("Your translated word is:",copy) replay = input("Play again? (y/n):") while(replay in answer): if replay in n_ans: continue else: break while(replay not in answer): print("Please enter y to continue or n to quit") replay = input("Play again? (y/n):")