The Shuffling problem.

Post a reply

Smilies
:Buttplugsmall: :Buttplugmedium: :Buttplugbig: :Inflatableplug: :Ponytailplug: :Analbeads: :Analballon: :Inflatabledildo: :Dildo: :Realisticdildo: :Strap-on: :Eggvibrator: :Vibrator2: :Vibrator3: :Vibrator: :Penispump: :Penisring: :Onahole: :Ballgag: :Tapegag: :Bitgag: :Ringgag: :Inflatablegag: :Bondagetape: :Candle: :Paddle.: :Rope: :Collar: :Sleepingmask: :Nosehook: :Chastity-Belt: :Handcuffs: :Whip: :Legspreader: :Leash: :Electrostimulation: :Lube: :Condom: :Enema-Kit: :Diaper: :Breastweight: :Nipplesuckers: :Nippleclamps: :Balletheels: :Pleaser: :Plateauheels: :Heels: :Shirt: :Dress: :Tanktop: :Underwear: :Skirt: :Swimsuit: :Twopieceswimsuit: :Thong: :Garterbelt: :Miniskirt: :Corset: :Wig: :Make-UP: :Fishnetoutfit: :Catsuit: :Gimpsuit: :Latexgloves: :Latexslip: :Latexstockings: :Cheerleader: :Pompom: :Sexybunny: :FrenchMaid: :Lolita: :Webcam: :Camera: :Mobile-Phone: :D :) ;) :( :o :? 8-) :x :P :|
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 20 MiB.

Expand view Topic review: The Shuffling problem.

Re: The Shuffling problem.

by Inside7shadows » 11 Apr 2016, 04:21

I create an array, then for each element in the array, I swap it with a random element in the array.

Code: Select all

Sub ShuffleArrayInPlace(InArray() As Variant)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' ShuffleArrayInPlace
' This shuffles InArray to random order, randomized in place.
'http://www.cpearson.com/excel/ShuffleArray.aspx
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Dim N As Long
    Dim Temp As Variant
    Dim J As Long
   
    Randomize
    For N = LBound(InArray) To UBound(InArray)
        J = CLng(((UBound(InArray) - N) * Rnd) + N)
        If N <> J Then
            Temp = InArray(N)
            InArray(N) = InArray(J)
            InArray(J) = Temp
        End If
    Next N
End Sub
This works well if you stack an instructions array with each type of instruction, then zip through it once with this. I don't remember how I populate the arrays with file locations. I also randomize the pictures between instructions using Standard Distribution.

Re: The Shuffling problem.

by Rothaon » 05 Apr 2016, 13:45

That would be a good idea.

Anyways, I've started to think that it isn't good to fix the number of images. Instead let the user to set a range between cards and get as many images as needed.

Re: The Shuffling problem.

by 0131 » 05 Apr 2016, 02:24

Well that doesn´t seem to be a problem, you can add extra rules to that algorithm.

1. Be sure for the first X loops that only a image is added thats very easy, just count the loops and add the rule to the randomnumber generator.
2. You could add more extra rules to the randomnumber generator so that if a card/monster was added then only images are added for x loops.

The only difficult part is to ensure that there are enough images in the tease to do that.

Re: The Shuffling problem.

by Rothaon » 03 Apr 2016, 21:49

Yes, that part exactly. Your method is too random for me though. Specially, for the Skirmish set.

I can fix the number of images between monsters between a range. But I'm not sure about doing that, I'd have to request at least X pictures before starting.

Btw, I have 4 lists. 3 lists of monsters (1 per level) and a list of pictures.

Re: The Shuffling problem.

by 0131 » 03 Apr 2016, 21:29

Hi, do you mean the part where you merge the images with the cards?

I handle it that way:

1. Create an Array or a List in the size of the images for tease
2. Do the same for each card type you use.
Now you have a bunch of arrays.
-----------------loop-----------------
3. Add their sizes together and draw a randomnumber between 0 and their size.
4. Make a method wich calculates which array has been hit with that randomnumber.
For example:
Images [0-200]
Nice Mitress [201-216]
...
Randomnumber = 205 -> add a Nice Mistress
5. Now you should know if a picture or a card (and the card type) has to be added.
6. Add the path of the picture or card to the slidelist.
7. Substract 1 from the size the Nice Mistress size and all following arrays.
8. Repeat X times where X is the total number of slides in the tease (= the size of all arrays added together at the start of the loop)
----------------------------------------

The Shuffling problem.

by Rothaon » 03 Apr 2016, 20:03

So, I was editing the CTI Slideshow program in order to automate the Skirmish set with it.

And then I found the part where it shuffles instructions and images. There was a formula I can't understand. And I haven't find (yet) a formula I like.

So, here's the question, how do you handle the deck shuffling?

Top