User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Logic problem that I can't figure out.

  1. #1
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)

    Logic problem that I can't figure out.

    it's probably very easy, but I can't seem to wrap my brain around it.

    What I am trying to accomplish is an some kinda of a lineup within 8 moves

    I have 3 listboxes with the following

    1 2 4
    2 8 3
    3 6 7
    4 9 1
    5 7 9
    6 5 8
    7 3 6
    8 1 2
    9 4 5


    What I want is try to find the best combination from left to right for the the
    highest number possible with 8 or less moves.
    See it a 3 slot machine reels that move up or down to get the best combination possible
    if any.

    Trying to figure this out for weeks, and I can't come up with something..
    Not even sure if it's possible..
    But I know there are some very smart people here

    Thank you

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)
    Do you mean you are checking each 3 digits

    First check is 1+2+4
    Second check is 2+4+2
    Third check is 4+2+8

    1.PNG2.PNG3.PNG

    If I had to do that I would put them all in one long string
    124283367491579658736812945

    Then build a loop that took 3 digits and got the total and then move one more digit down the line.

    But to be honest I don't really know if that is what you want to do or do something else.

  3. #3
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    it's for a Slot machine, for an "Autonudge" that moves the reels up or down trying to get the best win combination

    so if you have

    1 2 4
    2 8 3
    3 6 7
    4 9 1
    5 7 9 ---- Center Line
    6 5 8
    7 3 6
    8 1 2
    9 4 5

    then 7 7 7 would be one combination based of the center line
    reel 1 the 7 takes 2
    reel 2 the 7 takes 0
    reel 3 the 7 takes 2
    total of 4 nudges, so it's a winner.

    for 9 9 9
    reel 1 the 9 takes 4
    reel 2 the 9 takes 1
    reel 3 the 9 takes 0
    total of 5 nudges, so it's a winner.

    for 3 3 3

    reel 1 the 9 takes 2
    reel 2 the 9 takes 2
    reel 3 the 9 takes 3

    total of 7 nudges, so it's a winner.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    As I understand it:

    You're going to give each number a slot position.
    And then add together the slot positions
    And the number that adds up to the lowest score is your answer.

    Number Position
    4...............4
    3.............. 3
    7.............. 2
    1.............. 1
    9.............. 0
    8.............. 1
    6.............. 2
    2.............. 3
    5.............. 4

    1.............. 4
    2.............. 3
    3.............. 2
    4.............. 1
    5.............. 0
    6.............. 1
    7.............. 2
    8.............. 3
    9.............. 4


    2.............. 4
    8.............. 3
    6.............. 2
    9.............. 1
    7.............. 0
    5.............. 1
    3.............. 2
    1.............. 3
    4.............. 4


    add together:
    1 = 8
    2 = 10
    3 = 7
    4 = 9
    5 = 5
    6 = 5
    7 = 4 (2 + 2+ 0)
    8 = 7
    9 = 5

  5. #5
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I think I understand you, then the answer would be yes.
    The reels are either go up or down, in the hope to get a combination.
    it doesn't always happen though. if the symbols/numbers are too far away

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I also don't totally understand, but it seems like...

    Store each reel in an alterable string:
    reel1 = "123456789"
    reel2 = "286975314"
    reel3 = "437198625"

    Then...

    + whenever...
    -> set NumToCheck to 9 // I'm assuming 999 is "better" than 888?
    -> start fastloop "check", 9 times // there are 9 different numbers.

    + on loop "check"
    -> set Reel1Nudges to abs(4-findstringinstring( reel1, str$(NumToCheck), 0)) // the number of nudges needed to move the currently checked number to the middle of reel1.
    -> set Reel2Nudges to abs(4-findstringinstring( reel2, str$(NumToCheck), 0))
    -> set Reel3Nudges to abs(4-findstringinstring( reel3, str$(NumToCheck), 0))

    + on loop "check"
    + (Reel1Nudges+Reel2Nudges+Reel3Nudges) <= 8
    -> stop loop "check"

    + on loop "check"
    -> subtract 1 from NumToCheck

    After that, "NumToCheck" will be either 1~9 (if they can be matched in 8 or fewer nudges), or 0 if none can.

  7. #7
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Sounds like a mouth full MuddyMole.
    But you are right, and I will check it out as soon as I get home.. it looks promising..

    What I did forget to mention was that the numbers are all 2 digits. not 1 digit.

    so it's

    11
    12
    13
    ..
    ..
    24

    Since the reel has 24 numbers

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    That doesn't make a lot of difference. Just add a delimiter to your strings, and slightly modify the other code.
    eg.
    -> reel1 = "|01|02|03..."
    -> Set Reel1Nudges to abs(4-(findstringinstring( reel1, "|"+right$("0"+str$(NumToCheck),2), 0)/3))

  9. #9
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    is findstringinstring a command from some object?


    Nvm.. it was just Find( .... )

    it's been a long day.

  10. #10
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Hmm, Think something is wrong


    I selected the number 10, and ran the loop 24 times but the end result is a negative number.. shouldn't that be 0

    At the bottom you see the 3 strings that are being used (r1,r2 and r3)


    Here is the full image: https://www.dropbox.com/s/mr47kh3tg4...udges.png?dl=0
    Images attachées Images attachées

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Having a big problem and cant figure it out???
    By UnicornMan in forum iOS Export Module 2.5
    Replies: 8
    Last Post: 17th March 2015, 05:36 AM
  2. Problem, can any body help me out, cant figure out what to do.
    By Ryan9171 in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 18th March 2012, 08:37 PM
  3. What is the Logic Behind This? (negate object overlapping "logic")
    By Blue66 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 10th January 2012, 11:54 PM
  4. please help me with logic
    By stevanooz in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 12th October 2006, 04:19 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
  •