Advertisement
Ilikebugs

Improved Melee Tag Creator Python

Oct 10th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. import random
  2. consonant = ['b','c','d','f','g','h','l','j','k','m','n','p','q','r','s','t','w','v','x','y','z']
  3. #list of consanants
  4. vowel = ['a','e','i','o','u']
  5. #list of vowels
  6. typeLetter = random.randint(0,1)
  7. #Chooses whether the first letter is a vowel or consonant
  8. letter = 1
  9. #represents the position of the letter
  10. word=""
  11. #represents the word
  12. if typeLetter == 0:
  13.   nextLetter = consonant[random.randint(0,20)]
  14.   #makes the next letter a consonant
  15.   word+=nextLetter
  16. elif typeLetter == 1:
  17.   nextLetter = vowel[random.randint(0,4)]
  18.   #makes the next letter a vowel
  19.   word+=nextLetter
  20. while letter<4:
  21.   #means the word will not have more than 4 letters
  22.   if typeLetter==0:
  23.     if word[-1] == "q":
  24.       word+="u"
  25.       #makes it if the previous letter was q, make the next letter u
  26.     else:
  27.       word+=vowel[random.randint(0,4)]
  28.       #If previous letter was not a q, make the next letter a random vowel
  29.   elif typeLetter==1:
  30.     word+=consonant[random.randint(0,20)]
  31.     #makes the next letter a random consonant
  32.   if typeLetter==0:
  33.     typeLetter+=1
  34.     #makes the next letter consonant
  35.   elif typeLetter==1:
  36.     typeLetter-=1
  37.     #makes the next letter a vowel
  38.   letter+=1
  39.   #moves on to the next letter in the sequence
  40. print (word)
  41. #Should be a 4 letter word with all vowels being followed by consonants and vice versa, as well as q always being followed by u
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement