From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:a110:: with SMTP id k16mr28176847qke.285.1607873549949; Sun, 13 Dec 2020 07:32:29 -0800 (PST) X-Received: by 2002:a37:a80f:: with SMTP id r15mr26917247qke.84.1607873549743; Sun, 13 Dec 2020 07:32:29 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 13 Dec 2020 07:32:29 -0800 (PST) In-Reply-To: <04c03d8f-4120-4b94-843a-319aaf1ed9e9n@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2601:3c3:401:f550:9d5b:a9d4:6ed9:1c97; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 2601:3c3:401:f550:9d5b:a9d4:6ed9:1c97 References: <867dpmpy50.fsf@stephe-leake.org> <3739d281-8131-4096-b51d-11ac18647aecn@googlegroups.com> <04c03d8f-4120-4b94-843a-319aaf1ed9e9n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Advent of code day 12 From: John Perry Injection-Date: Sun, 13 Dec 2020 15:32:29 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:60824 List-Id: On Sunday, December 13, 2020 at 3:14:30 AM UTC-6, gautier...@hotmail.com wr= ote: > > I mostly agree, but I had trouble with today's puzzle. It's a recurring= problem of mine: if the input is not specified completely, I have trouble = figuring out what it is, even when I study it, so I often get subtle bugs. = And there's a LOT of input. In my input, a turn of 270 degrees doesn't show= up until line 85, so I didn't see it even after scanning the file (which I= did because I wanted to make sure it had integer-only positions and the tu= rns were multiples of 90). Once I figured that out, it was quite easy. > If you include all possible angles you don't encounter that issue :-)=20 >=20 > https://github.com/zertovitch/hac/blob/master/exm/aoc/2020/aoc_2020_12.ad= b Yes, I had looked at your code (and Max's) after finishing mine but before = replying here, so I was aware of it at the time. That is definitely one way= to avoid the issue :-) but I don't think you can use the approach I used i= n that case, of which I am perhaps far too fond: Left_Turn: array( Direction_Value, Direction_Delta ) of Direction_Value = :=3D ( ( West, South, East ), -- 90, 180, 270 from north ( East, North, West ), -- ...from south ( North, West, South ), -- ...from east ( South, East, North ) -- ...from west ); =20 so the code to perform a left turn is Direction :=3D Left_Turn(Direction, D); john perry