X-Git-Url: https://fbox.kageds.com/gitweb/adventofcode.git/blobdiff_plain/5f9e4a1b8833907b26c107c04ed6c4120700ac3c..b4e1a94b5704c5a3335f69c1850577fba80dc66d:/day3/day3.erl 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, _) ->