Computer Science Canada How to make 2d/3d int arrays in turing |
Author: | ynotpeace [ Tue Jan 05, 2010 6:20 pm ] | ||
Post subject: | How to make 2d/3d int arrays in turing | ||
What is it you are trying to achieve? I am trying to make a 2d/ 3d int array but dont know how. can anyone help me? What is the problem you are having? <Answer Here> Describe what you have tried to solve this problem <Answer Here> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using latest one |
Author: | registration [ Tue Jan 05, 2010 6:23 pm ] |
Post subject: | Re: How to make 2d/3d int arrays in turing |
2D arrays: var variableName : array low .. high, low2 .. high2 of type := init () not sure about 3D arrays.. why would you even need such a thing in turing? |
Author: | Zren [ Tue Jan 05, 2010 8:14 pm ] | ||
Post subject: | RE:How to make 2d/3d int arrays in turing | ||
Basically Mutidemsional arrays just add the extra , low3 .. high3.
|
Author: | DtY [ Tue Jan 05, 2010 8:51 pm ] | ||
Post subject: | RE:How to make 2d/3d int arrays in turing | ||
You can also use the more literal syntax, this is the same example as Zren gave:
They both mean the same thing, except this version is more literal, the other is often easier to read. When accessing them, you can index them with `cube(x,y,z)`, or `cube(x)(y)(z)`. The second one actually makes more sense, imo. |
Author: | ynotpeace [ Tue Jan 05, 2010 8:59 pm ] |
Post subject: | Re: How to make 2d/3d int arrays in turing |
Thanks for all your help. |