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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,aa7f494bf30adbc7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: [newbie] simple(?) data structures Date: 27 Jun 2004 15:12:34 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: <2j1e30Fsrg8vU1@uni-berlin.de> <2jao1qFvj2rgU1@uni-berlin.de> NNTP-Posting-Host: 80.241.165.36 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1088341954 23533 80.241.165.36 (27 Jun 2004 13:12:34 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Sun, 27 Jun 2004 13:12:34 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:1950 Date: 2004-06-27T15:12:34+02:00 List-Id: Roland Illig wrote: > type Stone is (Empty, Black, White); > type Player is (Black, White); You might want to make Player a subtype of Stone: subtype Player is Stone range Black .. White; That would remove the need for this declaration: > To_Stone : constant array (Player) of Stone := (Black => Black, > White => White); And since the colours assigned to the players are derived from the colours of the stones, it also makes sense from a logical point of view. > type Move is private; I would probably declare Move like this: type Move (Pass : Boolean := True) is record case Pass is when True => null; when False => X, Y : Positive; end case; end record; With this construction, Move.X and Move.Y are only available if Move.Pass is False. And if you had used a generic package, parametrized with the size of the board, I would definitely use the Board indexing type for Move.X and Move.Y. Jacob -- CAUTION BLADE EXTREMELY SHARP KEEP OUT OF CHILDREN