comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: New to Ada need help implementing Warshall's algorithm
Date: Mon, 26 Sep 2016 11:29:33 -0700 (PDT)
Date: 2016-09-26T11:29:33-07:00	[thread overview]
Message-ID: <4d87a1a7-b830-44d5-9b7f-90974ad6ddeb@googlegroups.com> (raw)
In-Reply-To: <80cedca4-c83d-4c40-920c-f3fddb8e1438@googlegroups.com>

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

  reply	other threads:[~2016-09-26 18:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 22:05 New to Ada need help implementing Warshall's algorithm James Brewer
2016-09-23  4:31 ` Shark8
2016-09-23  6:26   ` Simon Wright
2016-09-23 15:07     ` James Brewer
2016-09-25 16:06       ` Stephen Leake
2016-09-26 20:40         ` Simon Wright
2016-09-23 14:54   ` James Brewer
2018-02-12 17:45     ` Lucretia
2016-09-26 17:38 ` James Brewer
2016-09-26 18:29   ` Stephen Leake [this message]
2018-02-12 15:36 ` jre11712
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox