Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created November 15, 2011 13:45
Show Gist options
  • Save onlyshk/1367102 to your computer and use it in GitHub Desktop.
Save onlyshk/1367102 to your computer and use it in GitHub Desktop.
test() ->
Num = 232,
List = [{1, 0, 200}, {2, 200, 600}],
[{Num2, _, _}] = lists:filter(fun(X) ->
{Number, X1, X2} = X,
(Num >= X1) and (Num =< X2)
end,
List),
Num2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment