User Tag List

Results 1 to 4 of 4

Thread: generate random numbers with String expression

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    generate random numbers with String expression

    I need some help with the correct expression to display random values in a String.
    The task is to generate a String and show random numbers on command with the following rules:
    - String starts and ends with a semicolon and also has a semicolon between each value
    - String will show a minimum amount of random numbers(this is value A) from all numbers(specified with another value B).

    As example what the generated String could display...
    - if value A = 4, value B = 10:
    ;3;10;4;1;
    (this String with random values shows 4 different numbers(value A) as minimum which means that the String can also have 10 different numbers as a possible result - 10 as highest possible number with this setup(value B).
    ;7;3;5;10;6;8;1;4;9;2;

    further comments:
    - value A is always lower than value B
    - the order of numbers in the String is not important

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,267
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    This exactly what the string tokenizer and string parser object’s are for. You define a character that acts as a separator (called a delimiter) and then the parser/tokenizer cuts the string up into smaller strings (called elements). You then can retrieve as many elements as you want from any position in the string.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Yes, the String Parser object should do the job. Thanks mobichan!

    How should I use the delimiter function of the String Parser in this simple random setup?

    Every 00"-50
    - Set Global Value A to RRandom(1, 200)
    - Set alterable string to Str$(Global Value A)

    so that the random result will look like this:
    ;1;
    or another ;2;0;0; or ;5;7; or ;1;3;2;

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,267
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    You would parse your global string with the parser and set your delimiter to the semicolon. You will want a semicolon after every valid number in the string. Then you would choose a random element. Example: Set string to random(total number of elements).

Similar Threads

  1. Generate and display random numbers
    By sebaslunaquito in forum HTML5 Export Module 2.5
    Replies: 11
    Last Post: 12th May 2016, 07:45 PM
  2. string adding random .0 after numbers.
    By Shabadage in forum Android Export Module 2.5
    Replies: 2
    Last Post: 29th June 2015, 05:40 PM
  3. Can Install Creator Pro 'generate' (create) serial numbers?
    By Lionheart in forum Install Creator and Patch Maker
    Replies: 3
    Last Post: 24th July 2014, 04:49 PM
  4. Random Numbers and expiring the result numbers.
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th April 2013, 04:11 PM
  5. Random Numbers Greater then Random Numbers...
    By Hordolur in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 15th April 2009, 06:24 AM

Posting Permissions

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