Results 1 to 6 of 6

Thread: actionscript

  1. #1

    Default actionscript


    hi, i wish someone could help me with this.

    i got a array, which like consist of numbers...

    which the numbers look like this., 1,2,3,4,5,8,9,10;

    i need to extract the numbers that in successive order

    like 1, 2, 3, 4, 5 = are successive so what im looking for
    and 8,9,10 also successive,

    can somebody help me?

  2. #2

    Default Re: actionscript

    c# code..
    Code:
        List<List<int>> GetSuccessiveNumbers(List<int> lstArr)
        {
          List<List<int>> Ret = new List<List<int>>();
          List<int> iBuffer = new List<integer>();
          int i, itmp = lstArr[0];
    
          if (lstArr.Count == 0) return null;
          
          iBuffer.add(itmp);
          if (lstArr.Count > 2)
          {
            for (i = 1; i < lstArr.count; i++)
            {
              itmp = lstArr[i - 1];
              if (lstArr[i] == (itmp + 1))
              {
                ibuffer.add(lstArr[i]);
              }
              else
              {
                Ret.add(iBuffer);
                iBuffer = new List<int>();
                ibuffer.add(lstArr[i]);
              }
            }
          }
          else
          {
            Ret.Add(iBuffer);
          }
          return Ret;
        }
    i tranfer lang to flash actionScript bai kai naka limot nako ana actionScript

    also you might want to debug it pud kai wa na nako ma test hahaah.

  3. #3

    Default Re: actionscript

    ok... thanks for the code.

  4. #4

    Default Re: actionscript

    roy way to go...

  5. #5
    up!!!!!!!!!!!!!!!!!!!!

  6. #6
    @mclaine tnx for the up... but this was 4 years ago... anyway tnx again.

  7.    Advertisement

Similar Threads

 
  1. ActionScript - naay expert diri?
    By Metz in forum Programming
    Replies: 0
    Last Post: 12-10-2009, 07:38 AM
  2. Are there ActionScript 3 developers here?
    By ares623 in forum Programming
    Replies: 5
    Last Post: 10-29-2009, 01:35 PM
  3. Flash Actionscript Lovers
    By reypapz in forum Software & Games (Old)
    Replies: 2
    Last Post: 03-25-2009, 10:36 AM
  4. need help: flash actionscript
    By rynzco in forum Programming
    Replies: 15
    Last Post: 02-10-2008, 06:10 PM
  5. i need help with flash actionscript, or sample?
    By emailroy2002 in forum Programming
    Replies: 1
    Last Post: 10-09-2006, 02:34 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
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top