tags | languages | resources |
---|---|---|
collections, iteration, hashes, arrays, sorting, bonus |
ruby |
2 |
Esperanto is one of the most popular international auxiliary languages. These are languages meant for communication between people from different nations who do not share a common native language.
Write a method that will take an array of strings and sort them alphabetically based on the Esperanto alphabet. The Esperanto alphabet is pretty similar to the English alphabet, as you can see:
ESPERANTO_ALPHABET = "abcĉdefgĝhĥijĵklmnoprsŝtuŭvz"
For instance, the array below:
["mi amas vin", "bonan matenon", "pacon", "ĉu vi parolas esperanton"]
Should become:
["bonan matenon", "ĉu vi parolas esperanton", "mi amas vin", "pacon"]
If you'd like to know what these phrases or words translate to, translate them on Google Translate.
Think about how you would do this using the sort_by method.