Merge branch 'master' of https://fbox.kageds.com/gitweb/advent2021
This commit is contained in:
@@ -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, _) ->
|
||||
|
||||
72
day3/day3.hs
72
day3/day3.hs
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user