comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: matrix
Date: Tue, 23 Sep 2003 12:17:40 +0000 (UTC)
Date: 2003-09-23T12:17:40+00:00	[thread overview]
Message-ID: <slrnbn0ef4.nr.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: bkpd8v$evf$1@news.rz.uni-karlsruhe.de

* Daniel Sch�le wrote:
> what is the proper way to iterate through the matrix?

with Ada.Text_IO;
use Ada.Text_IO;

procedure t is
   type Matrix is array(Integer range <>, Integer range <>) of Integer;
   m: Matrix(1..10, 1..5) := (
     2 .. 5 => (3 .. 4 => 1, others => 0),
     others => (others => 0)
   );
begin
   for x in m'Range(1) loop
      for y in m'Range(2) loop
         Put(Integer'Image(m(x, y)));
      end loop;
      New_Line;
   end loop;
end t;
   



      reply	other threads:[~2003-09-23 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-23 12:05 matrix Daniel Sch�le
2003-09-23 12:17 ` Lutz Donnerhacke [this message]
replies disabled

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