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!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 02 Feb 2018 17:00:01 -0600 From: Dennis Lee Bieber 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: Fri, 02 Feb 2018 18:00:01 -0500 Organization: IISS Elusive Unicorn Message-ID: References: <87y3ki743m.fsf@jacob-sparre.dk> <40142b86-fdcf-49d3-bee7-2fdbb04c6db0@googlegroups.com> <8c806572-009d-4ba2-a20d-de1209e45ca6@googlegroups.com> User-Agent: ForteAgent/8.00.32.1272 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.118.195 X-Trace: sv3-ZEVrPmuGU4Lgormca/gnRSDMo8flYcvI3Zj1IHHWFOM+M7hWgIsw6ExLWA58AFki3JczJmgIhcaJ2hD!sIOfH5FFLMECff+cHDxaisrYrOcIE/hNinPJo3+Zf8UlSayz7drUH4cknqdx2cy/lf67KuF5bhVW!as81sI1kuJKO2fiS8Lz2TulZmXtn X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4032 X-Received-Bytes: 4154 X-Received-Body-CRC: 3509529074 Xref: reader02.eternal-september.org comp.lang.ada:50284 Date: 2018-02-02T18:00:01-05:00 List-Id: On Fri, 2 Feb 2018 11:07:31 -0800 (PST), Robert Eachus declaimed the following: >On Monday, January 29, 2018 at 6:17:01 PM UTC-5, Randy Brukardt wrote: > >> 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. > >It also depends on whether you want selection with or without replacement. To deal out a deck you want dealing without replacement (no two hands get the Queen of Hearts, or whatever). > Tarot layouts -- only one of each card... Presuming the common Celtic Cross spread, 1 significator (pulled from deck before shuffling -- represents the querant) and 10 cards dealt from the remaining 77. Queen of Cups would be the corresponding minor arcana card. Hearts -> Cups, Spades -> Swords, Clubs -> Wands, Diamonds -> Pentacles (Coins). >To shuffle a deck, make an array of 78 records with an Integer and a Long_Float. Assign the Integer field 1 through 78. Assign (78) random Long_Floats to the other field, then apply whatever sort algorithm you wish. (I tend to use a generic heap sort, but with only 78 values, you will spend more time setting things up and assigning random values than anything else.) You can either use these values to indirectly index into your cards, or just add the Long_Float field and let the sort shuffle the card values. > >Why go through sorting the Long_Float values? If you draw without replacement, you draw from 78 cards, then 77, 76, 75,...4,3,2,1. There is nothing in Ada's random number generators to guarantee that these 78 generators work together to produce random values. By choosing 78 values from the same generator you don't have that problem. > For some reason my mind is visualizing actually emulating a (imperfect) riffle shuffle. Especially if one is using upright and inversed divinatory meanings. Start with the deck tagged as "all upright"... Repeat 3 times Select (random) a split point (39 +/- some limit, say 10). Cards before the split are "left hand", after the split are "right hand" Toggle the upright/invert flag on all the cards in the "right hand" (this represents rotating "head to head") repeat until both hands are empty select 2 +/- 1 (this represents the "imperfect" of the riffle) cards from "left hand" select 2 +/- 1 cards from the "right hand" {A perfect riffle would always split at 39, and would alternate 1 card from each hand} -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/