Skip to content

Instantly share code, notes, and snippets.

@sammylupt
Created February 10, 2016 17:25
Show Gist options
  • Save sammylupt/7e51c6def2c244dfaa24 to your computer and use it in GitHub Desktop.
Save sammylupt/7e51c6def2c244dfaa24 to your computer and use it in GitHub Desktop.
defmodule HappyNumberFinder do
# def get_sum(number)
def find(number) do
sum = get_sum(number)
case sum do
1 -> {:happy}
_ -> find(sum)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment