# Randomizing Arrays with linked multiple values

**URL:** https://forum.kirupa.com/t/randomizing-arrays-with-linked-multiple-values/273722
**Category:** flash
**Created:** [October 19, 2008, 6:06pm UTC](https://forum.kirupa.com/t/randomizing-arrays-with-linked-multiple-values/273722 "2008-10-19T18:06:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)
#### Post date: [October 19, 2008, 6:06pm UTC](https://forum.kirupa.com/t/randomizing-arrays-with-linked-multiple-values/273722/1 "2008-10-19T18:06:14Z")

</div>

I am currently using this AS to randomize an array:

```auto

function shuffle(wordtestmix,b):Number {
var num : Number = Math.round(Math.random()*2)-1;
return num;
}
var wordtest:Array = wordtestmix.sort(shuffle);
trace(wordtest);

```

However, at the moment my array is a list of single values. I would like to add another set of values that are linked to the first

i.e  
[value 1, value1b],[value2,value2b],[value3,value3b]

and would still like to randomize the array without splitting the two values up.

What is the best way to declare this type of array and also adjust the randomize code in order to mix it correctly.

Much appreciated 🙂
