14 lines
332 B
Erlang
14 lines
332 B
Erlang
-module(day1).
|
|
-export([charcount/1]).
|
|
-export([counter/1]).
|
|
-export([print/1]).
|
|
|
|
charcount([]) -> 0;
|
|
charcount([_ | Rest]) -> 1 + charcount(Rest).
|
|
|
|
counter(10) -> 10;
|
|
counter(N) -> counter(N + 1).
|
|
|
|
print(success) -> io:write("success");
|
|
print({error, Message}) -> io:write(unicode:characters_to_list(["error: ", Message], utf8)).
|