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?

Recommended Answers

All 2 Replies

It is basically the same as counting in base 4.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.