This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def translate_into_pig_latin(word) | |
if word[0] == "a"|| word[0]== "e" || word[0] == "i"|| word[0] == "u" || word[0] == "o" | |
word+"ay" | |
elsif (word[0] != "a"|| word[0] != "e" || word[0] != "i"|| word[0] != "u") && (word[1] == "a" || word[1] == "o" || word[1] == "e" || word [1] == "i" || word[1] == "u") && word[0..1] != "qu" | |
word[1..-1]+word[0]+"ay" | |
elsif (word[0] != "a"|| word[0] != "e" || word[0] != "i"|| word[0] != "u") && (word[1] != "a" || word[1] != "o" || word[1] != "e" || word [1] != "i" || word[1] != "u") | |
word[2..-1]+word[0..1]+"ay" | |
elsif word[0..1]="qu" | |
word[2..-1]+"quay" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def leap_year?(year) | |
if year % 4 == 0 && year%100 > 0 | |
true | |
elsif year%400 == 0 | |
true | |
else | |
false | |
end | |
end |