Last active
August 29, 2015 14:11
Revisions
-
diogovk revised this gist
Dec 11, 2014 . 2 changed files with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +0,0 @@ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ defmodule Stuff do def inlist([search_item|_tail], search_item), do: true def inlist([_head|tail], search_item) , do: inlist(tail, search_item) def inlist([], _), do: false end IO.inspect(Stuff.inlist([1,2,3],1)) IO.inspect(Stuff.inlist([4,2,3],1)) -
diogovk created this gist
Dec 11, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ defmodule Stuff do def inlist([search_item|_tail], search_item), do: true def inlist([_head|tail], search_item) , do: inlist(tail, search_item) def inlist([], _), do: false end IO.inspect(Stuff.inlist([1,2,3],1)) IO.inspect(Stuff.inlist([4,2,3],1))