summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--2021/day06.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/2021/day06.pl b/2021/day06.pl
new file mode 100644
index 0000000..b296a4c
--- /dev/null
+++ b/2021/day06.pl
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+my @fish = split(/,/, <>);
+for (1..80) {
+	my @spawns;
+	for my $f (@fish) {
+		if ($f) {
+			$f--;
+		} else {
+			$f = 6;
+			push @spawns, 8;
+		}
+	}
+	push @fish, @spawns;
+}
+print scalar(@fish), "\n";
/cgit-pink/commit/ui-log.c?h=1.3.0&id=2101e26fd68f816e77de62b93df4c32fd1110d0c&follow=1'>Add a common commit parserLars Hjemli 2006-12-14Add simple pager to log pageLars Hjemli 2006-12-13Add separate makefile-rule to clear current cacheLars Hjemli 2006-12-13Remove implementation details from READMELars Hjemli 2006-12-13Small layout adjustments to summary and blob viewLars Hjemli 2006-12-13Add display of tree content w/ui-tree.cLars Hjemli 2006-12-12cache_lock: do xstrdup/free on lockfileLars Hjemli 2006-12-11Don't truncate valid cachefilesLars Hjemli 2006-12-11Move global variables + callback functions into shared.cLars Hjemli 2006-12-11Move functions for generic object output into ui-view.cLars Hjemli 2006-12-11Move log-functions into ui-log.cLars Hjemli 2006-12-11Move repo summary functions into ui-summary.cLars Hjemli 2006-12-11Move functions for repolist output into ui-repolist.cLars Hjemli 2006-12-11Move common output-functions into ui-shared.cLars Hjemli 2006-12-11Rename config.c to parsing.c + move cgit_parse_query from cgit.c to parsing.cLars Hjemli 2006-12-11Avoid infinite loops in caching layerLars Hjemli 2006-12-11Let 'make install' clear all cachefilesLars Hjemli 2006-12-11Fix cache algorithm loopholeLars Hjemli 2006-12-10Add version identifier in generated filesLars Hjemli 2006-12-10Add license file and copyright noticesLars Hjemli 2006-12-10Add caching infrastructureLars Hjemli