User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Best way to confirm that a series of values are different from each other?

  1. #11
    Clicker Multimedia Fusion 2
    Lethia's Avatar
    Join Date
    Apr 2012
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    AND doesn't work like that, it is a bitwise AND.

    As for checking if they really are all different, I believe this should work:
    (A XOR B) + (A XOR C) + (B XOR C)
    =
    0
    Ah, I wasn't aware of that. My knowledge of bitwise operators isn't much so far, and I had only tinkered with that a bit through experimenting.

    I must admit, I have no idea how XOR works in an equation like that, but I tried assigning it to a counter with the usual examples.

    (1 XOR 2) + (1 XOR 3) + (2 XOR 3) = 6
    (1 XOR 2) + (1 XOR 2) + (2 XOR 2) = 6

    Hm, I'm not sure what else to try at this point. Perhaps it would be best to try something like the Random Pool extension? Since I began programming, I've been trying to limit my dependence on extensions, mostly for compatibility concerns, but this might be a good candidate for an exception.

    Any other ideas would be welcomed though. I appreciate the help.

  2. #12
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I've personally tested and confirmed that this works:
    (A-B)*(A-C)*(B-C)
    <>
    0
    Working as fast as I can on Fusion 3

  3. #13
    Clicker Multimedia Fusion 2
    Lethia's Avatar
    Join Date
    Apr 2012
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    I've personally tested and confirmed that this works:
    (A-B)*(A-C)*(B-C)
    <>
    0
    I see. Check every combination within a single equation, and if any value subtracts from another that's the same, it results in a zero, which in turn makes everything else a zero when multiplied together.

    That does seem to work just right, but it seems to still have it's limitations on how many combinations it can tackle at once. The size of the equation starts to grow very quickly as I get into more values, and it eventually tells me that the expression is too complicated.

    It should work when I'm not dealing with so many values though, which isn't likely to come up too often, so that's very helpful to know.

    I came up with an alternative idea for when I'm dealing with a lot of values. Each value could have a 'checker counter' that checks its respective value against all the others. If any are the same, it sets to 0. If it's unique, it sets to 1. That would be two events for each value, plus another one at the end to check if all of the checking counters equal 1. If they do, it proceeds to the next step.

    That would only be how I went about it when I'm dealing with far too many values for a single expression though, as I'd rather avoid the extra counters. Anyway, thank you very much for the help. I think I've got enough to go ahead with this now.

  4. #14
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You don't have to do the equation in a single expression. All that is happening is a check between two variables, a check to see if subtracted from each other they equal zero. You can easily run a loop that checks a value against every other value, then moves to the next value, until all values are checked.

    If two variables subtracted from each other equal zero, then stop the loop early and conclude they are the same number.
    If the comparison loop reaches the final loop without being stopped early you may conclude all values are unique.

  5. #15
    Clicker Multimedia Fusion 2
    Lethia's Avatar
    Join Date
    Apr 2012
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ChrisBurrows View Post
    You don't have to do the equation in a single expression. All that is happening is a check between two variables, a check to see if subtracted from each other they equal zero. You can easily run a loop that checks a value against every other value, then moves to the next value, until all values are checked.

    If two variables subtracted from each other equal zero, then stop the loop early and conclude they are the same number.
    If the comparison loop reaches the final loop without being stopped early you may conclude all values are unique.
    Ah, that's a good idea. I had done something similar with AI targeting, and it seems to do the job, so that should work.

    Thanks for the tips. This should definitely help me with what I'm trying to do.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Video Tutorial Series
    By Jeff in forum News
    Replies: 0
    Last Post: 7th June 2012, 06:11 PM
  2. [Request]Confirm message for global object synchronization
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd February 2012, 11:41 AM
  3. Possible Big Bug (Please Confirm)
    By Atom in forum SWF/Flash Export Module Version 2.0
    Replies: 17
    Last Post: 25th March 2010, 04:05 PM
  4. Ok... can someone please confirm a bug or not?
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 8th July 2009, 02:58 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
  •