I’ve got an algorithm that selects a cell in a 3d array and then reads or writes the data wich is a reference to another 3d array. Think of it as a “minecraft” algorithm.
The problem is i have no idea how to make a data structure in Perl that works like this : @3darray(x,y,z) = value
Can you help me?
I’ve got an algorithm that selects a cell in a 3d array and then
Share
If I understand correctly:
Output:
However, there’s no need to make this structure beforehand, since Perl creates it for you through autovivification (see reference further down) when you access an element in the nested structure:
Output:
From perlglossary:
As for looping, if you need indexes:
Otherwise: