I would like to make this simplified so that I can control how many nested for loops there are. Essentially this would be 3
for d1 in ['left','right','up','down']:
for d2 in CreateDirectionList(d1):
for d3 in CreateDirectionList(d2):
#Do something with list [d1, d2, d3]
return False
and 4 would be
for d1 in ['left','right','up','down']:
for d2 in CreateDirectionList(d1):
for d3 in CreateDirectionList(d2):
for d4 in CreateDirectionList(d3):
#Do something with list [d1, d2, d3, d4]
return False
I am pretty much a beginner.
CreateDirectionList
just returns a list with 2 strings based on a string input