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.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: Advent of Code Date: Thu, 3 Dec 2020 18:20:39 +0100 Organization: A noiseless patient Spider Message-ID: References: <9dab63e0-617f-43a3-a0a3-eac0ae049afcn@googlegroups.com> <2ecfe1ae-5b2b-4719-901c-ee9bbc1dce03n@googlegroups.com> <861rg7izdn.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 3 Dec 2020 17:20:39 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="af93a8404a5e8d2a8321d0e119acbb82"; logging-data="30620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182U/S8B/vRi//RB6y1hpJ1" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:wbv6vdjom1meTG51l2jv5BqoWgk= In-Reply-To: Content-Language: sv Xref: reader02.eternal-september.org comp.lang.ada:60683 List-Id: Den 2020-12-03 kl. 15:52, skrev Wendel Wang: > Hi. > > Here is result so far.I am just learning Ada, so any comments welcome. > > https://gitlab.com/MarcusE1W/prog/-/tree/master/ada/aoc > > I was wondering for example if there is a way to read the data from day 2 as a record data structure? You can read it item by item, but is there a way to do it as a record? > I guess you can use Ada.Direct_io. I did not look at the inputfile, but I guess i has the same format as the frontpage. You need to define a record that can fit the data. Here's an old course and its example -- Björn