F.hao 16 Posted September 9, 2020 Hi there, how can i make a two-dimensional array at 1.4 virsion? Like declare a array[3][3],then set the value,array[0,0]=1,array[0,1]=2,array[0,2]=3,array[1,0]=4,array[1,1]=5,array[1,2]=6,and so on.Can someone show me a sample?(i'm in confuse) Share this post Link to post Share on other sites
NaruTheHuman 94 Posted September 9, 2020 Hello there. You have to create some temporary local array and use it to set the inside elements, and then push this temp array into the main array as one index. I've made an example here, where I set the TEMP ARRAY to values 1, 2 and 3, and then push this array to MAIN ARRAY. That means that MAIN ARRAY[0] will now be = {1,2,3}. You can then access this array as I've shown with the write to console tile, first one returns 1,2,3, and the second one will return 2. Once you actually set up your array with some values, you can access and change individual values through SET and GET array tiles, but its important to always set them at first, as you can't access something that isn't really there. 2 1 Share this post Link to post Share on other sites
F.hao 16 Posted September 10, 2020 @NaruTheHuman thank you, i try it and i think i get the point about my confuse. like in the picture.i think this maybe a bug. i don't konw, but just let you know this. Or maybe my code not right? Share this post Link to post Share on other sites
Houp 237 Posted September 10, 2020 @F.hao : in the first For loop you need to create a new "row" in each iteration. In your case you have just created an array "A" which has 3 items which are all the same. You have there 3 times array "B" which has last set of numbers (20, 21, 22) Just put there "Local variable" inside the first loop. Then you will create totally 4 different arrays. (opposed to 2 arrays which you have in your example) Share this post Link to post Share on other sites
F.hao 16 Posted September 10, 2020 11 minutes ago, Houp said: @F.hao : in the first For loop you need to create a new "row" in each iteration. In your case you have just created an array "A" which has 3 items which are all the same. You have there 3 times array "B" which has last set of numbers (20, 21, 22) Just put there "Local variable" inside the first loop. Then you will create totally 4 different arrays. (opposed to 2 arrays which you have in your example) wellllllllll,after google time, i think i understand.this reference address.thank you. Share this post Link to post Share on other sites