Skip to content

Instantly share code, notes, and snippets.

@Hajto
Last active September 11, 2015 19:35
Show Gist options
  • Save Hajto/956e2d4258363ea628d3 to your computer and use it in GitHub Desktop.
Save Hajto/956e2d4258363ea628d3 to your computer and use it in GitHub Desktop.
Andrzej's task
defmodule Andrzej do
def getData(s), do: String.replace(IO.gets(s),"\n","")
def gIndex(list,elem), do: Enum.find_index(list, fn x -> x == elem end)
def testCombinator (listS) do
x = [" pierwsza forma "," druga forma "," trzecia forma ", " polski "]
listP = List.zip([x,listS])
Enum.map(listS, fn a -> Enum.map(listP,
fn {b,c} ->
unless gIndex(listS,a) == gIndex(x,b) do
getData(a <> "=>" <> b) == c
end
end)
end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment