From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.67.14.106 with SMTP id ff10mr5649232pad.132.1474914574021; Mon, 26 Sep 2016 11:29:34 -0700 (PDT) X-Received: by 10.157.59.194 with SMTP id k60mr1443178otc.10.1474914573979; Mon, 26 Sep 2016 11:29:33 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!o21no88031itb.0!news-out.google.com!w143ni13437itb.0!nntp.google.com!x192no4888641itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 26 Sep 2016 11:29:33 -0700 (PDT) In-Reply-To: <80cedca4-c83d-4c40-920c-f3fddb8e1438@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 References: <955937c4-b9f9-4e21-9d22-98382df2f45f@googlegroups.com> <80cedca4-c83d-4c40-920c-f3fddb8e1438@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4d87a1a7-b830-44d5-9b7f-90974ad6ddeb@googlegroups.com> Subject: Re: New to Ada need help implementing Warshall's algorithm From: Stephen Leake Injection-Date: Mon, 26 Sep 2016 18:29:33 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31903 Date: 2016-09-26T11:29:33-07:00 List-Id: On Monday, September 26, 2016 at 12:38:16 PM UTC-5, James Brewer wrote: > example: > > ColName1 ColName2 ColName3 ColNameN > RowName1 0 0 0 0 > RowName2 1 1 1 1 > RowName3 0 1 0 0 > RowNameN 0 1 1 0 > > > WITH Text_IO; USE Text_IO; -- This gets the IO facility. > WITH Ada.Integer_Text_IO; USE Ada.Integer_Text_IO; -- This gets the integer IO facility. > --**** > -- use zero elements in array to store size 0,0 and row/column names? not necessary. > -- read size Read the first line, count the spaces (trim trailing spaces if needed). use Ada.Strings.Fixed.Index to find the spaces. > -- use size to read names of columns split the first line at the spaces. > -- use size to read first row of data? Read the whole line, split at spaces. > -- if value read = 0 => array2d(n,n) = false can be: array2d(n, n) := read = 0; -- Stephe