There is little to no documentation on multi-dimensional arrays so I wanted to confirm two things before I start writing a YT video script explaining what they are and why they're so weird.
- When I'm getting a value in an array, Y comes before X, yes? Like if I were to use this:
int array1[13][8] = {
{0, 1, 2, 3, 4, 5, 6, 7},
{1, 97, 109, 121, 92, 64, 245, 101},
{2, 98, 110, 122, 124, 36, 241, 119},
{3, 99, 111, 43, 60, 38, 49, 114},
{4, 100, 112, 45, 62, 39, 50, 97},
{5, 101, 113, 95, 63, 34, 51, 115},
{6, 102, 114, 40, 46, 35, 52, 100},
{7, 103, 115, 41, 33, 96, 53, 27},
{8, 104, 116, 91, 44, 94, 54, 11},
{9, 105, 117, 93, 126, 8, 55, 20},
{10, 106, 118, 123, 59, 27, 56, 33},
{11, 107, 119, 124, 58, 9, 57, 63},
{12, 108, 120, 47, 42, 20, 48, 47}
};
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.println(array1[3][2]);
}
I would get an output of 111
on serial? I'm asking because when I run this code on TinkerCAD it gives that output, but TCAD Circuits doesn't have the most reliable systems in place.
- I wouldn't assume you could make arrays with 3+ dimensions...