# Question about arrays

**URL:** <https://forum.kirupa.com/t/question-about-arrays/312322>\
**Category:** Uncategorized\
**Created:** [July 30, 2010, 3:48pm UTC](https://forum.kirupa.com/t/question-about-arrays/312322 "2010-07-30T15:48:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Solarflare](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Solarflare](https://forum.kirupa.com/u/Solarflare)\
**Post date:** [July 30, 2010, 3:48pm UTC](https://forum.kirupa.com/t/question-about-arrays/312322/1 "2010-07-30T15:48:49Z")

</div>

Hi everyone 🙂

Wonder if you can help, I am trying to split the data in an array, but not in the conventionalsense and I’m not sure if it is easy to do, or even possible.

Basically, I have an array that holds simple string data pertaining to tiles, and how they should be put on the screen (it is for themain map on a game). I have made the tiles and can sort out the array with a for loop to put the appropriate tile in the appropriate place, however I also want them to face the right direction (with .rotation) rather than doing 4 different facing tiles for each tile. Here is a little demo of what im on about (written up in a few seconds, hence ‘var bob’ lol.)

```php
var levelArray:Array = new Array();
levelArray = [1,1,1,3,2,2,3,1,1,1,1,3,2,2,2,2]
for(var i=0;i<levelArray.length;i++){
    var grass:Grass = new Grass();
    var water:Water = new Water();
    var coastA:CoastA = new CoastA();
    var bob;
    if(levelArray* == 1){
        bob = grass;
    }else if(levelArray* == 2){
        bob = water;
    }else if(levelArray* == 3){
        bob = coastA
    }
    bob.x=50*i;
    bob.y=25;
    addChild(bob)
}

```

Now What I want, ideally is to have the array hold a number and a dierection [1N,3E,2N] etc, and for the number, and the letter to be treated seperately…I just don’t now how to. Can you split the terms in an array, so that i could check the tyle type then check its derection before adding? Or am I totally barking up the wrong tree with this idea? 😕
