summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--2021/day12.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/2021/day12.pl b/2021/day12.pl
index a47c9b0..90f3e54 100644
--- a/2021/day12.pl
+++ b/2021/day12.pl
@@ -11,7 +11,7 @@ while (<>) {
 my $paths = 0;
 my @queue = (['start']);
 while (@queue) {
-	my @path = @{shift @queue};
+	my @path = @{pop @queue};
 	my %visited = map { $_ => 1 } @path;
 	for (@{$edges{$path[0]}}) {
 		if ($_ eq 'end') {
@@ -28,7 +28,7 @@ print "$paths\n";
 $paths = 0;
 @queue = (['start']);
 while (@queue) {
-	my @path = @{shift @queue};
+	my @path = @{pop @queue};
 	my (%visited, $twice);
 	for (@path) {
 		$twice = 1 if $visited{$_}++ && /[a-z]/;
> 2018-08-04Split source into several filesJune McEnroe Can't believe I have to do this. 2018-08-04Exit on zero readJune McEnroe 2018-08-04Handle nick errorsJune McEnroe 2018-08-04Handle /nick and /quitJune McEnroe /quit doesn't actually... quit, right now. The only way to know that the connection is closed is tls_read returning zero, it seems. 2018-08-04Track own nickJune McEnroe 2018-08-04Word all status messages in presentJune McEnroe 2018-08-03Handle inputJune McEnroe This turned out a lot better than expected. Still a long way to go in terms of line-editing, but at least backspace works! 2018-08-03Track own usernameJune McEnroe So that we can colour our own messages correctly. 2018-08-03Use a wide pad for the topicJune McEnroe 2018-08-03Ignore NOTICEs not sent to the channelJune McEnroe 2018-08-03Handle KICK and NICKJune McEnroe 2018-08-03Continue on EINTR from pollJune McEnroe Resizing the terminal causes it. 2018-08-03Handle ACTIONsJune McEnroe 2018-08-03Use more octal char literalsJune McEnroe I might be coming around to octal. 2018-08-03Send a WHO in response to NAMES to get usernamesJune McEnroe Other than this slight hack, I think coloring by username rather than nick is a much better idea. 2018-08-03Colorize nicks and channelsJune McEnroe 2018-08-03Add support for mIRC colorsJune McEnroe 2018-08-03Handle bold, italic, underlineJune McEnroe 2018-08-03Add prift function for "prefix shift"June McEnroe Forgive me. 2018-08-03Link with -lcurseswJune McEnroe 2018-08-02Use libtls "compat" ciphersJune McEnroe irc.mozilla.org, using GnuTLS, doesn't support *any* of the "secure" ciphers! 2018-08-02Add UI and handle some kinds of server messagesJune McEnroe Seems like handling input is going to be the worst thing ever. 2018-08-02Add chroot.tar targetJune McEnroe