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.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,7d1a02b763945274 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.110.68 with SMTP id m4mr79022qap.2.1358308486533; Tue, 15 Jan 2013 19:54:46 -0800 (PST) Received: by 10.49.87.9 with SMTP id t9mr16804415qez.16.1358308486513; Tue, 15 Jan 2013 19:54:46 -0800 (PST) Path: k2ni11qap.0!nntp.google.com!p13no566611qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 15 Jan 2013 19:54:46 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=134.240.94.90; posting-account=CZZpzgoAAAAoaHoNNp9zhY9EzQgEmxhU NNTP-Posting-Host: 134.240.94.90 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <23c44925-1fd0-4b87-8b50-2cd876fbf424@googlegroups.com> Subject: Re: Algorithms Homework Help?!?! From: willmann817 Injection-Date: Wed, 16 Jan 2013 03:54:46 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-01-15T19:54:46-08:00 List-Id: On Tuesday, January 15, 2013 7:01:59 PM UTC-5, willmann817 wrote: > On Tuesday, January 15, 2013 6:54:19 PM UTC-5, Jeffrey Carter wrote: > > > On 01/15/2013 02:52 PM, willmann817 wrote: > > > > > > > > > > > > > > function Candy(Kids : Integer; MsPerColor : Int_Array) return Integer is > > > > > > > lo : Integer := 1; > > > > > > > hi : Integer := 50000; > > > > > > > mid : Integer; > > > > > > > begin > > > > > > > for I in MsPerColor'Range loop > > > > > > > if MsPerColor(I) > hi then > > > > > > > hi := MsPerColor(I); > > > > > > > end if; > > > > > > > if MsPerColor(I) < lo then > > > > > > > lo := MsPerColor(I); > > > > > > > end if; > > > > > > > end loop; > > > > > > > > > > > > Will you ever have more than 50,000 M&Ms of any one color? If not, then Hi will > > > > > > remain 50,000. Will you ever have less than 1 M&M of any one color? If not, then > > > > > > Lo will remain 1. > > > > > > > > > > > > -- > > > > > > Jeff Carter > > > > > > "My legs are gray, my ears are gnarled, my eyes are old and bent." > > > > > > Monty Python's Life of Brian > > > > > > 81 > > Jeff I changed the initial values of lo and hi but there is still something getting me stuck in an infinite loop. > > lo : Integer := Integer'Last; > > hi : Integer := Integer'First; Nevermind everyone I got the answer and figured it out with hints one of my classmates.