erlang day1
This commit is contained in:
parent
fd69c6e68c
commit
f40104937d
13
erlang/day1.erl
Normal file
13
erlang/day1.erl
Normal file
@ -0,0 +1,13 @@
|
||||
-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)).
|
Loading…
Reference in New Issue
Block a user