Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by janusztracz73ms
def translation(phrase):
samo = ["a", "e", "i", "o", "u", "y"]
spol = [ "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z"]
g = []
for x in range(len(phrase)):
g.append(phrase[x])
for y in range(len(g)):
try:
if g[y] in spol:
print(g[y])
g.pop(y+1)
elif g[y] in samo:
print(g[y])
print(y+2)
g.pop(y+2)
g.pop(y+1)
except IndexError:
break
phrase = "".join(g)
return phrase
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert translation("hieeelalaooo") == "hello", "Hi!"
assert translation("hoooowe yyyooouuu duoooiiine") == "how you doin", "Joey?"
assert translation("aaa bo cy da eee fe") == "a b c d e f", "Alphabet"
assert translation("sooooso aaaaaaaaa") == "sos aaa", "Mayday, mayday"
Nov. 25, 2016