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: a07f3367d7,8147387fe25d4e2a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Mart van de Wege Newsgroups: comp.lang.ada Subject: Re: Random number generation Date: Thu, 30 Dec 2010 13:11:14 +0100 Message-ID: <86zkrna2al.fsf@gareth.avalon.lan> References: <864o9vbkwz.fsf@gareth.avalon.lan> <4d1c64f7$0$23757$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net pI6gZ1bdAMJM2Bs9zdPkVgRcpaEgBwRL7d6ynKT5yi8dvVdUgX X-Orig-Path: gareth.avalon.lan!not-for-mail Cancel-Lock: sha1:x+CNfWQsFRuf94g5NneLG093PEw= sha1:UXeQ28qRE9VL1CbxZeMqukfQmIA= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: g2news2.google.com comp.lang.ada:17222 Date: 2010-12-30T13:11:14+01:00 List-Id: Thomas Løcke writes: > On 2010-12-30 11:43, Mart van de Wege wrote: >> Anyone care to at least point me to some documentation that explains >> what I'm doing wrong? > > > Hey Mart, > > We have a dice-roller article at the Ada-DK wiki: > > http://wiki.ada-dk.org/index.php/The_Dice_Roller_Program > Hmm. If I look at dice-random.adb, it looks like the same algorithm I'm using. And yet if I run my test program, I get multiple same values. A different value at each run, to be sure, so it looks like I'm doing something wrong so that the generator only gives me one value. > If you don't care about the article, you can just grab the code here: > > https://github.com/ThomasLocke/The-Dice-Roller > > Also there's a Rosetta Code example: > > http://rosettacode.org/wiki/Random_numbers#Ada I had seen that one before, but it's using Float_Random. Not that I am opposed to doing it using Float_Random, but I was just trying to get my head around Discrete_Random, and I thought I had understood it. Mart -- "We will need a longer wall when the revolution comes." --- AJS, quoting an uncertain source.