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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d7c081f926f119a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-14 09:41:13 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem from a Newbie References: <4003b00c_2@news.tm.net.my> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Wed, 14 Jan 2004 17:41:12 GMT NNTP-Posting-Host: 63.184.32.254 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1074102072 63.184.32.254 (Wed, 14 Jan 2004 09:41:12 PST) NNTP-Posting-Date: Wed, 14 Jan 2004 09:41:12 PST Xref: archiver1.google.com comp.lang.ada:4409 Date: 2004-01-14T17:41:12+00:00 List-Id: Dennis Lee Bieber wrote: > Cycle : float := 360.0; --use degrees directly in sin() > HalfWidth : float := 30.0; --scale 0..1 to 0..30 (and -1..0) > StepCycle : float := Cycle / 45.0; --reduce total points > Length : integer := integer((2.0 * Cycle) / StepCycle); --#points These all appear to be constants, and should be declared as such. The first 3 could be named numbers. > > Point : float; > Position : float; > > begin > for i in 0..Length loop > Point := ff.sin(float(i) * StepCycle, Cycle); > Position := Point * HalfWidth + HalfWidth + 1.0; > new_line; > for j in 0..integer(Position) loop > put(" "); --space output across line > end loop; > put("*"); > end loop; > end wave; -- Jeff Carter "We use a large, vibrating egg." Annie Hall 44