Last active
August 29, 2015 14:11
-
-
Save diogovk/148894bf73f33c328acc to your computer and use it in GitHub Desktop.
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
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment