From 9159a85282b18b21fb0456247519ccfc9fd2c230 Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Thu, 9 Dec 2021 17:59:43 +0000 Subject: [PATCH] tidy up --- day9/day9.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/day9/day9.erl b/day9/day9.erl index 25c5547..ae181db 100644 --- a/day9/day9.erl +++ b/day9/day9.erl @@ -56,12 +56,12 @@ solution2(Table) -> get_basins(Low_points, Table) -> - get_basins(Low_points, Table, 0, []). + get_basins(Low_points, Table, []). -get_basins([], _Table, _, Basins) -> Basins; -get_basins([Low_point|Rest], Table, Count, Basins) -> +get_basins([], _Table, Basins) -> Basins; +get_basins([Low_point|Rest], Table, Basins) -> Basin = [Low_point|lists:usort(get_up_slopes([Low_point], Table))], - get_basins(Rest, Table, Count + 1, [Basin|Basins]). + get_basins(Rest, Table, [Basin|Basins]). low_points([H|_] = Table) -> X = length(H),