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,b328eee5522f8a6c X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [Beginner Problem] Varibles not getting assigned correctly References: <13oe10uh39g0v85@corp.supernews.com> In-Reply-To: <13oe10uh39g0v85@corp.supernews.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <21Ohj.295340$Fc.165485@attbi_s21> NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1200073918 12.201.97.213 (Fri, 11 Jan 2008 17:51:58 GMT) NNTP-Posting-Date: Fri, 11 Jan 2008 17:51:58 GMT Organization: AT&T ASP.att.net Date: Fri, 11 Jan 2008 17:51:58 GMT Xref: g2news1.google.com comp.lang.ada:19318 Date: 2008-01-11T17:51:58+00:00 List-Id: Shane Smith wrote: > > type pits is array (1 .. 14) of Integer; > type Score_Type is array (1 .. 2) of integer; Your code would be easier to understand (and hence to comment on) if you were consistent in your capitalization. What does it mean for a pit or a score to be negative? Perhaps Natural or another type or subtype based on the rules of the game would be better for the component types here. I presume the index of Score_Type represents a specific player. Using numbers is probably not a good way to identify a player; an enumeration type might be better: type Player_ID is (Human, Computer); or some such. > type arr_point is access pits; > board : arr_point; I see no reason to use access types in this program. > procedure Status (Player : in integer) It appears that the purpose of Status is to assign to Winner. It's usually clearer to pass parameters than to modify global variables. I would think you'd want something like procedure Status (Player : in Player_ID; Board : in Pits; Winner : out Player_ID); Others have addressed your questions, so I won't repeat that here. I haven't used a debugger for years, so I find it usually quicker to stick in some output that to relearn how to use one. Given that gdb sometimes misbehaves, it can be more effective, too. -- Jeff Carter "Propose to an Englishman any principle, or any instrument, however admirable, and you will observe that the whole effort of the English mind is directed to find a difficulty, a defect, or an impossibility in it. If you speak to him of a machine for peeling a potato, he will pronounce it impossible: if you peel a potato with it before his eyes, he will declare it useless, because it will not slice a pineapple." Charles Babbage 92