1.11M Members

Say I have the set 0-3 what's an effecient way to

 
0
 

go through every combination ie(0,0,0,0),(0,0,0,1), .... ,(3,3,3,3)

But in a general way such that it's always 0-3, but it may be 4 digits or it may be 5 digits or any other number?

If I know the length I could do nested for loops, but since I don't...is there an effecient and general way to do it?

 
2
 

It is basically the same as counting in base 4.

Question Answered as of 1 Year Ago by mvmalderen
 
0
 

Thanks!

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article