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,a10fc2d4d530dd05 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news2.google.com!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Random number generation Date: Tue, 13 Jul 2010 16:33:39 -0400 Organization: The Wasteland Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 13 Jul 2010 20:33:39 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="XHGR0soRZbMj+IDq9rKW3w"; logging-data="20596"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EOVC29NLmKSM/I5nPvlmTV+GIO/OmbAc=" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:401YPsPDuNtZFm9uLvnXS5tBfl8= Xref: g2news1.google.com comp.lang.ada:12402 Date: 2010-07-13T16:33:39-04:00 List-Id: In article , "Jeffrey R. Carter" wrote: > On 07/13/2010 05:45 AM, tonyg wrote: > > I want to generate a random integer and a random floating point > > number between 10 and 30 . I've been looking at previous posts and > > finding it a little confusing with many packages, has anyone an > > already done example in ada 2005 they can post up? Here's an Ada 95 example that uses Ada.Numerics.Discrete_Random to simulate repeated plays of a simple card game: The shuffling algorithm needs work; this might be an alternative: > The random integer is pretty easy to do with an appropriate [sub]type > and Ada.Numerics.Discrete_Random. The random floating-point is a bit > more difficult, and there's always the question of whether 30.0 must > be a possible value. You can have a look at Random_Range in > PragmARC.Universal_Random: > > http://pragmada.x10hosting.com/pragmarc.htm As an aside, Mine Detector V6.0 builds on Mac OS X 10.5.8 with GtkAda 2.14.1 and GNAT 4.3.4. Wait, I took a picture: -- John B. Matthews trashgod at gmail dot com