summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--2021/day06.pl8
1 files changed, 2 insertions, 6 deletions
diff --git a/2021/day06.pl b/2021/day06.pl
index 3fc7ac2..6e5fa15 100644
--- a/2021/day06.pl
+++ b/2021/day06.pl
@@ -16,14 +16,10 @@ for (1..80) {
 }
 print scalar(@fish), "\n";
 my %counts;
-for (@init) {
-	$counts{$_}++;
-}
+$counts{$_}++ for @init;
 for (1..256) {
 	my $zeros = $counts{0} // 0;
-	for (0..7) {
-		$counts{$_} = $counts{$_+1};
-	}
+	$counts{$_} = $counts{$_+1} for 0..7;
 	$counts{8} = $zeros;
 	$counts{6} += $zeros;
 }
amp;follow=1'>Lighten dark whiteJune McEnroe 2019-07-25Add png.3 man pageJune McEnroe 2019-07-25Use scheme to style HTMLsJune McEnroe 2019-07-25Don't match comments in strings in makeJune McEnroe 2019-07-25Generate index.html with links from bin.7June McEnroe 2019-07-24Warn when date has changedJune McEnroe 2019-07-24Add whenJune McEnroe When? Now. 2019-07-24Remove histedit from bitJune McEnroe