Something like a spiral-sort?
http://chattyfig.figleaf.com/pipermail/flashcoders/2005-March/134713.html

hth
-------------
Andreas Weber


-----Ursprungliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von Mike
Mountain
Gesendet: Mittwoch, 17. Januar 2007 16:37
An: Flashcoders mailing list
Betreff: [Flashcoders] Algo's to change the ordering of arrays


I'm looking for some simple algo's to change the ordering of an array
which represents squares in a grid:

In the first instance I want to translate from

0 3 6
1 4 7
2 5 8

Existing Array=new Array(0,3,6,1,4,7,2,5,8)

To:

0 1 2
7 8 3
6 5 4

(0,1,2,7,8,3,6,5,4)

Ideally I'd want a whole bunch of these to produce pretty patterns by
changin a particular MC's property in the grid. I'm thinking there must
be stuff like this already out there - but I'm not even sure what I
should be googling!

But I want this to be scaleable for any grid, x by y represented by an
array.


Anyhow - any help would be greatly appreciated.

Ta

Mike







ECM Systems Ltd, Ellifoot Park, Burstwick, East Yorkshire HU12 9DZ

Tel: 01964 672000
Fax: 01964 671102

Registered in England no. 01646471

The information contained within this email expresses the views of the
sender and not necessarily those of the company.
It is private and confidential and may be legally privileged. It is intended
solely for those authorised to receive it. If you are
not the intended recipient you are hereby notified that any disclosure,
copying, distribution or action taken in reliance on its
contents is strictly prohibited and may be unlawful. If you have received
this email in error, please telephone us immediately
on 01964 672000 or email a reply to highlight the error and then delete it
from your system. This email may contain links to
web-sites, the contents of which ECM Systems Ltd have no control over and
can accept no responsibility for. Any
attachments have been virus-checked before transmission; however, recipients
are strongly advised to carry out their own
virus checking as ECM Systems Ltd do not warrant that such attachments are
virus-free.
Please note that this email has been created in the knowledge that Internet
email is not a secure communications medium.
We advise that you understand and observe this lack of security when
emailing us.



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to