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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Card game deck but with trumps suit for tarot "divination" Is there a better way than enumerating all cards? Date: Mon, 29 Jan 2018 17:16:59 -0600 Organization: JSA Research & Innovation Message-ID: References: <87y3ki743m.fsf@jacob-sparre.dk> <40142b86-fdcf-49d3-bee7-2fdbb04c6db0@googlegroups.com> Injection-Date: Mon, 29 Jan 2018 23:17:00 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="20807"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50206 Date: 2018-01-29T17:16:59-06:00 List-Id: wrote in message news:40142b86-fdcf-49d3-bee7-2fdbb04c6db0@googlegroups.com... ... >I make a Deck, Initialize it (with all 78 "divinatory meanings" of cards) >call >this Shuffle and draw then a number of cards. My code is not ideal, it just >happen to work, but I've did only some PHP programming and assembler >programming back in 80s on 8-bit home computer. It is rather hard to get proper random selection of cards with the Ada random number generator. It is real easy to write something that doesn't end up with a uniform distribution. We had a long discussion of that a few years ago, and because of it, Ada 2020 has an additional Random function in Discrete_Random to select from a run-time range. Dunno if this is available in GNAT yet. I didn't look at your code to see if it is OK or not. If you do it wrong, some cards would be more likely to be selected than others, which is likely to skew the results of your program. Randy.