Question: Undefined for loop bound

I want to define a proc in Maple which gets an integer n and gives a set of arrays like {1,2,3}^n, meaning {[a[1],...,a[n]]|for all 1<=i<=n a[i] in {1,2,3}}. For a fix n, obviously one can use n-for, for example when n is 2

for a[1] from 1 by 1 to 3 do
 for a[2] from 1 by 1 to 3 do
 end for:
end for:

But when n is not fixed, how can I tell Maple to consider n for?! Also how can ask him to make a n-dimensional array?

Please Wait...