User Tag List

Results 1 to 6 of 6

Thread: shuffle with 4 counters

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    warlords's Avatar
    Join Date
    Oct 2011
    Location
    Dk
    Posts
    388
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    shuffle with 4 counters

    Hi

    I was doing a shuffle system. I have 4 Counters.

    How I can make sure that every counter have diffrent number, 33,22,94,48

    If Counter 1 = Counter 2 then shuffle ...

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,350
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    If the range isn't too high you could populate a list with all the numbers, pick a random line and store the value, assign that value to a counter, delete the line and then repeat the process for the other counters. If there are too many numbers though to pick from, this method wouldn't be ideal as the list object is rather slow. Though there are probably array extensions that can be used instead that are faster.

    Alternatively you can assign a value by starting a fastloop an infinate number of times, and stop it when the value is different from all currently assigned values.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    Sep 2017
    Location
    Milano, Italy
    Posts
    130
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Popcorn View Post

    Alternatively you can assign a value by starting a fastloop an infinate number of times, and stop it when the value is different from all currently assigned values.
    If you have only four counters I think this is the best way to do it.
    - Start a Fastloop
    - On Loop set a random number on all counter
    - On Loop chek if: counter1<>counter2 AND counter1 <> counter3 AND counter1 <> counter 4 + counter2 <> counter3 AND counter2 <> counter4 + counter3 <> counter4, if all of this check are true then stop the loop

    Something like this, press space to randomly set the counters numbers.
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    anatol's Avatar
    Join Date
    Jun 2016
    Posts
    119
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Here is my idea.
    First - Store whole numbers in one list.
    Then pull some numbers from it. And then put back
    In this case you will never got the same numbers.

    Hope it will help you
    Attachment 25666
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 (Steam)
    bad_rick's Avatar
    Join Date
    Jul 2014
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did an example some time ago.
    It's about shuffling an array.

    maybe it helps...

    https://community.clickteam.com/threads/102879-Shuffle-an-Array-(Dynamic-Array)?highlight=shuffle

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    warlords's Avatar
    Join Date
    Oct 2011
    Location
    Dk
    Posts
    388
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for examples ....

Similar Threads

  1. Card Shuffle animation?
    By TheOriginator in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 29th February 2012, 12:53 PM
  2. How to shuffle List Object lines
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 20th February 2012, 08:29 AM
  3. Shuffle Sample Files in specific Directory
    By 2dgamers in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th April 2011, 06:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •