But this is Nim, you can do Anything (TM) :D
iterator pairs(r: array[0 .. 1, HSlice[system.int, system.int]]): tuple[a:
int, b: int] =
for r1 in r[0]:
for r2 in r[1]:
yield (r1, r2)
for x, y in [0 .. 3, 0 .. 3]:
echo x, " ", y
Run
Outputs:
0 3
1 0
1 1
1 2
1 3
2 0
2 1
2 2
2 3
3 0
3 1
3 2
3 3
Run
