Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,10 @@
defmodule RC do
def reverse_words(txt) do
txt |> String.split("\n") # split lines
|> Enum.map(&( # in each line
&1 |> String.split # split words
|> Enum.reverse # reverse words
|> Enum.join(" "))) # rejoin words
|> Enum.join("\n") # rejoin lines
end
end

View file

@ -0,0 +1,13 @@
txt =
"---------- Ice and Fire ------------\n" <>
" \n" <>
"fire, in end will world the say Some\n" <>
"ice. in say Some \n" <>
"desire of tasted I've what From \n" <>
"fire. favor who those with hold I \n" <>
" \n" <>
"... elided paragraph last ... \n" <>
" \n" <>
"Frost Robert -----------------------"
IO.puts RC.reverse_words(txt)