repl.it
@JerryTheMouse/

igPay atinLay anslatorTray

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from replit import clear as c
from time import sleep as s
consonants = [66,67,68,70,71,72,74,75,76,77,78,80,81,82,83,84,86,87,88,89,90,98,99,100,102,103,104,106,107,108,109,110,112,113,114,115,116,118,119,120,121,122]
vowels = [65,69,73,79,85,97,101,105,111,117]
newstring = ""
languageChoice = "What string would you like to translate to Pig Latin?: "
for index in languageChoice:
  print(index,end="")
  s(0.05)
lchoice = input("")
s(0.5)
c()
words = lchoice.split(" ")
counter = 0
for piglatin in range(len(words)):
  word = words[counter]
  if ord(word[0]) in vowels:
    newstring += word + "way "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants and ord(word[4]) in consonants and ord(word[5]) in consonants and ord(word[6]) in consonants and ord(word[7]) in consonants and ord(word[8]) in consonants:
    becons = word[:9]
    ending = word[9:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants and ord(word[4]) in consonants and ord(word[5]) in consonants and ord(word[6]) in consonants and ord(word[7]) in consonants:
    becons = word[:8]
    ending = word[8:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants and ord(word[4]) in consonants and ord(word[5]) in consonants and ord(word[6]) in consonants:
    becons = word[:7]
    ending = word[7:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants and ord(word[4]) in consonants and ord(word[5]) in consonants:
    becons = word[:6]
    ending = word[6:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants and ord(word[4]) in consonants:
    becons = word[:5]
    ending = word[5:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants and ord(word[3]) in consonants:
    becons = word[:4]
    ending = word[4:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants and ord(word[2]) in consonants:
    becons = word[:3]
    ending = word[3:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants and ord(word[1]) in consonants:
    becons = word[:2]
    ending = word[2:]
    newstring += ending + becons + "ay "
    counter += 1
  elif ord(word[0]) in consonants:
    becons = word[0]
    ending = word[1:]
    newstring += ending + becons + "ay "
    counter += 1
  else:
    newstring += word + " "
    counter += 1
print(newstring)
?