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,FREEMAIL_FROM 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,CP1252 Path: g2news1.google.com!postnews.google.com!k19g2000yqc.googlegroups.com!not-for-mail From: tonyg Newsgroups: comp.lang.ada Subject: Re: Random number generation Date: Thu, 15 Jul 2010 12:01:06 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 89.240.65.107 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1279220466 13049 127.0.0.1 (15 Jul 2010 19:01:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Jul 2010 19:01:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k19g2000yqc.googlegroups.com; posting-host=89.240.65.107; posting-account=28F2IwkAAACL1Z5nRC-dE7zuvWdbWC7P User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12437 Date: 2010-07-15T12:01:06-07:00 List-Id: On 14 July, 05:42, "John B. Matthews" wrote: > In article , > =A0"Jeffrey R. Carter" wrote: > > > On 07/13/2010 01:33 PM, John B. Matthews wrote: > > > > The shuffling algorithm needs work; this might be an alternative: > > > > > > > The problem with this (for Ada) is the need to instantiate > > Discrete_Random for a different range each time (although you could > > use PragmARC.Universal_Random.Random_Int). > > Thank you for suggesting this; I see the problem, now. Section > A.5.2(50), Note 16, mentions the very problem, suggesting Float_Random > as an alternative: > > > > I also found this implementation using Discrete_Random: > > > > > If it's for a game with a human, then the biased version of using the > > full range each time is good enough. > > No, it's a simulation; I don't get off that easy. > > > > 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: > > > > > > > Cool. I wouldn't check any boxes with only 100 mines. > > They were smiling for the camera! :-) > > -- > John B. Matthews > trashgod at gmail dot com > Thanks for the help guys