Skip to content

Instantly share code, notes, and snippets.

@migerh
Created August 15, 2015 15:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save migerh/f0355a5b7c4c49f59d69 to your computer and use it in GitHub Desktop.
Save migerh/f0355a5b7c4c49f59d69 to your computer and use it in GitHub Desktop.
erlang
-module(day1).
-export([count/1]).
-export([count10/0]).
-export([check/1]).
count([32| Rest]) -> count(Rest) + 1;
count([_| Rest]) -> count(Rest);
count([]) -> 1.
count10(10) -> 10;
count10(N) ->
io:write(N),
io:fwrite("\n"),
count10(N + 1).
count10() -> count10(1).
check(success) -> io:fwrite("success~n");
check({error, Message}) -> io:fwrite("error: ~s~n", [Message]).
@tuafeeqahmed
Copy link

Can you write money denomiton code in erlang?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment