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 17:03:21 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!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: Thu, 15 Jan 2004 01:03:20 GMT NNTP-Posting-Host: 63.184.1.29 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1074128600 63.184.1.29 (Wed, 14 Jan 2004 17:03:20 PST) NNTP-Posting-Date: Wed, 14 Jan 2004 17:03:20 PST Xref: archiver1.google.com comp.lang.ada:4415 Date: 2004-01-15T01:03:20+00:00 List-Id: Jeffrey Carter wrote: > 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; I apologize for leaving this big chunk of quoted text at the end for now reason. It's something I try to avoid. -- Jeff Carter "We use a large, vibrating egg." Annie Hall 44