undar-lang/test/array.ul

30 lines
438 B
Plaintext

nat[6] fixed_size = [1, 2, 3, 4, 5, 6];
nat[] variable_size = [1, 2, 3];
nat[] other_vsize = [4, 5, 6]
nat i = 0;
nat len = array.length;
while (i < len) {
print(array[i] as str);
print("\n");
i = i + 1;
}
print("\n");
for (i in array) {
print(i as str);
print("\n");
}
for (i in combine_arrays(variable_size, other_vsize)) {
print(i as str);
print("\n");
}
halt;
function combine_arrays(nat[] a, nat[] b) {
}