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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Passing a 2d array into a package and returning the same processed 2d back to main Date: Wed, 5 Oct 2016 11:57:04 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <44638b2d-c7fb-4113-9262-d57dd1cd5629@googlegroups.com> <241a25d0-e840-4d2f-b39f-e5bcdf9a6209@googlegroups.com> <23322f1c-76c2-4ab5-8098-421a3394bc04@googlegroups.com> <1410516a-584f-4fb1-94a2-57bb9ee80a57@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 5 Oct 2016 18:56:52 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6df4b173985f7c5c043cea362c370ff7"; logging-data="18079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18o6KZageDCAEHizL9bmbvzxB00QjQLWKQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 In-Reply-To: <1410516a-584f-4fb1-94a2-57bb9ee80a57@googlegroups.com> Cancel-Lock: sha1:dkBynxCUJHjIYqn5vVlrX/jlVH4= Xref: news.eternal-september.org comp.lang.ada:31999 Date: 2016-10-05T11:57:04-07:00 List-Id: On 10/05/2016 10:19 AM, James Brewer wrote: > > Well, I thought it worked by I'm just getting 1's for the output. How value do you input when asked "How many nodes need to be processed? " If it's less than 9, the remaining elements in the array will have random values ("stack junk") which will probably be True at least half the time. Since your algorithm processes all the elements in the 9x9 array, the odds are good that every node will end up being True. The correction is not to declare the array until you know how big it needs to be. -- Jeff Carter "You can never forget too much about C++." 115