mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Compound assignment for arrays is working, untested, read more
I added reference values in 62ca7a1fb7,
but forgot to mention it. I'm now using references to assign to the
internals of an array, no matter how many levels deep it is.
This commit is contained in:
19
scripts/compound.toy
Normal file
19
scripts/compound.toy
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
//1-D array
|
||||
var arr = [1, 2, 3];
|
||||
arr[1] = 6;
|
||||
print arr;
|
||||
|
||||
|
||||
|
||||
//we need to go deeper
|
||||
var barr = [
|
||||
[1, 2, 3],
|
||||
[4, 5, 6],
|
||||
[7, 8, 9]
|
||||
];
|
||||
|
||||
barr[1][1] = 99;
|
||||
|
||||
print barr;
|
||||
Reference in New Issue
Block a user