oh, the first list was the starting list, and the second was the goal
lol, that explains a lot. I was thinking you were saying like, array[0] = array[5] or something
(the confusion came from you using "=" instead of "==")
anyway idk GML, but this would work in javascript
function cascade(oldArray, x) {
var array = [];
for (var i = 0; i < oldArray.length; i++) {
array[i + x] = oldArray[i];
}
return array;
}
the x argument is for the number of places you want to move everything up. to get what you want, you'd just use 1
< x = [1, 2, 3]
< y = ['hey', 'hi', 'hello']
< z = [3, 2, 1]
< cascade(x, 1)
> [undefined, 1, 2, 3]
< cascade(y, 2)
> [undefined, undefined, "hey", "hi", "hello"]
< cascade(z, 3)
> [undefined, undefined, undefined, 3, 2, 1]