Given a set of characters and a number I’m trying to generate all possible sequences. For example, given
“ACTG” to generate all possible sequences of length 2 I could do.
letters = "ACTG"
for i in letters
for j in letters
print(i,j," ")
end
end
AA AC AT AG CA CC CT CG TA TC TT TG GA GC GT GG
And say n = 3 I could do
for i in letters
for j in letters
for k in letters
print(i,j,k," ")
end
end
end
My question is how can I do this with Julia’s metaprogramming?