X-Git-Url: https://fbox.kageds.com/gitweb/adventofcode.git/blobdiff_plain/1517295a267908fd7e7141b59b99cc3a85a09f57..6110e756509bd8f5dee5228640be7c2d33d67d95:/day3/day3.erl?ds=sidebyside diff --git a/day3/day3.erl b/day3/day3.erl index 0f506c3..b8be566 100644 --- a/day3/day3.erl +++ b/day3/day3.erl @@ -11,7 +11,7 @@ solve() -> init:stop(). solve(A) -> - solve(A, get_test_data()). + solve(A, get_data()). solve(['1'], D) -> io:format("The solution to ~p puzzle1 is: ~p~n", [?MODULE, solve(1, D)]); @@ -60,7 +60,6 @@ get_count_list([H|_] = D) -> get_count_list(D, init_acc(length(H), [])). get_count_list([], Acc) -> - io:format("~p~n", [Acc]), Acc; get_count_list([H|T], Acc) -> get_count_list(T, lists:zipwith(fun(X, {Ones, Zeros}) -> @@ -75,6 +74,7 @@ init_acc(Len, Acc) -> %% Convert binary list to integer, e.g. "1011" -> 11 dec bl2int(CL) -> + io:format("convert ~p~n", [CL]), bl2int(lists:reverse(CL), 0, 0). bl2int([], Acc, _) ->