Last active
August 29, 2015 14:16
-
-
Save RussellAndrewEdson/63aaae9fd56a38d27854 to your computer and use it in GitHub Desktop.
Rule 1 for the MIU system.
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
# Returns true if we can apply Rule 1 to the given string. | |
# (Rule 1: If the string ends with an I, we can add on a U at the end.) | |
def can_apply_rule1?(str) | |
str.end_with?("I") | |
end | |
# Applies Rule 1: We add a U to the end of the given string. | |
def apply_rule1(str) | |
str + "U" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment