User Tag List

Results 1 to 3 of 3

Thread: Taking various digits from various counts and combining them into a single number.

  1. #1
    No Products Registered

    Join Date
    Apr 2016
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Taking various digits from various counts and combining them into a single number.

    Hey, I'm trying to simulate a Abacus and use it to solve randomly generated questions. But I'm stuck on this one thing I want to do:

    Let's say I have a 3 column Abacus (it's a 10 column one I'm working on but I want to make this short, ignore that a 3 column Abacus is useless.) There are three counters tracking three column variables. Variable A is at "3", Variable B is at "6", and Variable C is at "8". I want to combine these numbers into the number "368" (ABC), and not as the number "17" (A+B+C). By doing this I think I can write a pretty efficient way of comparing the results of the abacus and the answer. How can I go about this?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS 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)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    1,013
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I'm sure there is a proper mathematical way of doing this but I suck at numbers so I have another solution until a math wizard comes along!

    Basically I would give an Active object four values(a, b, c, d) and set them as 3, 6, 8 and leave d as 0 for now, this value will be the result. Then in the Event Editor do this Action at whatever Condition you'd like to trigger the "calculation":

    ("Active"):
    Set Alterable Value D to Val(Str$(a( "Active" )) + Str$(b( "Active" )) + Str$(c( "Active" )))

    This should return the numbers as 368 to value d instead of 17. Basically what happens is that Fusion has to treat the numbers as it would strings. And strings don't add the same way values do.

    For instance 3+6+8 = 17 while "a" + "b" + "c"= "abc"

    So what we're doing is converting the values to strings temporarily and add them together into "abc". When we're done we convert the result back into our new value.

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    ( 100 * a ) + ( 10 * b ) + c

Similar Threads

  1. work with 10 digits number ?
    By arthurh in forum Fusion 2.5
    Replies: 3
    Last Post: 27th October 2015, 04:24 PM
  2. Replies: 3
    Last Post: 1st July 2015, 02:58 PM
  3. Replies: 2
    Last Post: 4th January 2015, 11:21 PM
  4. Count number of Characters or Digits?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd November 2012, 11:27 PM
  5. Replies: 4
    Last Post: 29th October 2012, 10:01 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
  •