undar-lang/test/mat-search.ul

37 lines
753 B
Plaintext

nat[3,3,3] matrix = [1, 1, 1,
1, 1, 1,
1, 1, 1,
1, 1, 1,
1, 0, 1,
1, 1, 1,
1, 1, 1,
1, 1, 1,
1, 1, 1];
nat xSize = 3;
nat ySize = 3;
nat zSize = 3;
bool found = false;
for (nat x = 0; x < xSize; x++) {
for (nat y = 0; y < ySize; y++) {
for (nat z = 0; z < zSize; z++) {
if (matrix[x][y][z] == 0) {
print("found: [");
print(x as str);
print(",");
print(y as str);
print(",");
print(z as str);
print("]\n");
found = true;
break;
}
}
if (found) break;
}
if (found) break;
}