-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After undertaking it myself
- Loading branch information
Showing
6 changed files
with
53 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# Develop your work so far to handle sentences | ||
# e.g. "The quick fox jumped over the lazy dog" -> | ||
# "Ethay ickquay oxfay umpedjay overway ethay azylay ogday" | ||
# Develop your work so far to preserve the existing capitalisation of the word | ||
# e.g. Dog -> Ogday | ||
# cram -> amcray | ||
# | ||
# Assume words either start with a capital letter or don't — don't worry about | ||
# other formats | ||
|
||
def pig_latin(sentence) | ||
def pig_latin(word) | ||
|
||
end | ||
|
||
## Tests: | ||
|
||
require_relative './helpers/assert_equal' | ||
assert_equal( | ||
pig_latin('The quick fox jumped over the lazy dog'), | ||
'Ethay ickquay oxfay umpedjay overway ethay azylay ogday' | ||
) | ||
assert_equal(pig_latin('Dog'), 'Ogday') | ||
assert_equal(pig_latin('cram'), 'amcray') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Write the program to reverse the above | ||
# e.g. "Ethay uickqay oxfay umpedjay overway ethay azylay ogday" -> | ||
# "The quick fox jumped over the lazy dog" | ||
# Develop your work so far to handle sentences | ||
# e.g. "The quick fox jumped over the lazy dog" -> | ||
# "Ethay ickquay oxfay umpedjay overway ethay azylay ogday" | ||
|
||
def reverse_pig_latin(sentence) | ||
def pig_latin_sentence(sentence) | ||
|
||
end | ||
|
||
## Tests: | ||
|
||
require_relative './helpers/assert_equal' | ||
assert_equal( | ||
reverse_pig_latin('Ethay ickquay oxfay umpedjay overway ethay azylay ogday'), | ||
'The quick fox jumped over the lazy dog' | ||
pig_latin_sentence('The quick fox jumped over the lazy dog'), | ||
'Ethay ickquay oxfay umpedjay overway ethay azylay ogday' | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Write the program to reverse the above | ||
# e.g. "Ethay uickqay oxfay umpedjay overway ethay azylay ogday" -> | ||
# "The quick fox jumped over the lazy dog" | ||
|
||
def pig_latin_sentence_reverse(sentence) | ||
|
||
end | ||
|
||
## Tests: | ||
|
||
require_relative './helpers/assert_equal' | ||
assert_equal( | ||
pig_latin_sentence_reverse('Ethay ickquay oxfay umpedjay overway ethay azylay ogday'), | ||
'The quick fox jumped over the lazy dog' | ||
) |