Computer Science Canada MultiDimensonal Array Question |
Author: | Nathan4102 [ Fri Dec 12, 2014 9:58 pm ] | ||||
Post subject: | MultiDimensonal Array Question | ||||
Silly Question... For a multidimensional array in Turing, e.g.
Is there syntax to access/assign the 1d/2d arrays within mapShapes? e.g. 2D - mapShapes[x], 1D - mapShapes[x][y]. I've tried the below code, but it doesn't compile unless I include all 3 parameters. Thanks
|
Author: | Zren [ Fri Dec 12, 2014 11:53 pm ] | ||
Post subject: | RE:MultiDimensonal Array Question | ||
In Turing, you can't really treat a multidimensional array like it's an array of an array unfortunately. At least not with that syntax.
You need to define the array like b is defined. |
Author: | Raknarg [ Sat Dec 13, 2014 6:47 pm ] |
Post subject: | RE:MultiDimensonal Array Question |
Wow I never knew they were different, I assumed they were functionally identical. |
Author: | Nathan4102 [ Sat Dec 13, 2014 9:22 pm ] |
Post subject: | RE:MultiDimensonal Array Question |
Huh I didn't even know arrays could be declared like b. It'll work for me, thanks! |