Hello everyone!
I was consulting the message forum and looking at the documentation, but I’m still at a bit of a loss for how to do this.
I’d like to take a small Array2D of 4x4…and I’d like to insert it into a larger, separate Array, 40x40.
Generating the small array is easy.
~array = [[0, 1, 0, 0], [0, 1, 0, 0], [0, 1, 1, 1], [0, 0, 0, 0]];
~array = Array2D.fromArray(4, 4, ~array.flatten);
Generating a big, blank array is easy.
~bigArray = Array2D.new(40, 40);
But I’m not sure what to do next. I tried the following, but I can tell something is wrong…
~array.do{|r, in1|
r.do{|c, in2|
in2.postln;
~bigArray.put(10+in1, 10+in2, c);
}};
Anyway, thanks for the help!