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=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?ISO-8859-1?Q?Markus_Sch=F6pflin?= Newsgroups: comp.lang.ada Subject: Re: Lotto simulation Date: Mon, 16 Jun 2014 13:40:26 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <77cc4476-8c57-481b-afb9-8f53f8b16e37@googlegroups.com> NNTP-Posting-Host: MdpKeRr+sx3LK7JQiK5aNw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 1583 Xref: number.nntp.dca.giganews.com comp.lang.ada:186959 Date: 2014-06-16T13:40:26+02:00 List-Id: Am 15.06.2014 19:07, schrieb montgrimpulo: > Hi, > > this is a placeholder of the task which I am trying to solve in Ada. > As you may know in German Lotto there are 49 numbers 1..49 > from which you have to select 6 numbers to place a bet. [...] The easiest way AFAIK is to random shuffle an integer array containing the numbers 1 - 49 and then selecting the first six numbers from that array. Random shuffling can be achieved by filling a second array of the same size with random numbers obtained from a generator having a uniform distribution and then sorting this second array; moving the numbers from the first array in lock-step. HTH, Markus