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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aa7f494bf30adbc7,start X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Roland Illig Newsgroups: comp.lang.ada Subject: [newbie] simple(?) data structures Date: Sun, 13 Jun 2004 00:23:28 +0200 Message-ID: <2j1e30Fsrg8vU1@uni-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de eb6BQpHagwfhmzan59+AJwHl4Wh7f58Ibc+ya4QCNOBf2jSiY= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040528 Debian/1.6-7 X-Accept-Language: de-de, de, en-us, en Xref: g2news1.google.com comp.lang.ada:1430 Date: 2004-06-13T00:23:28+02:00 List-Id: Hi, I'm doing my first steps with Ada. I tried to model a Go board and failed. In Java/C++, I would do it like this: enum Stone { Empty, Black, White }; class Go_Board { private Stone[][] data; public Go_Board(int size) { data = new Stone[size][size]; } public int getWidth() { return data[0].length; } public int getHeight() { return data.length; } public Stone getStone(int x, int y) { return data[y][x]; } } /* EOF */ How can I do this in Ada? I already tried something with packages and generics, but that did not look nice. But I want it to look nice and Adaish. Roland