Nov-19-2019, 02:45 PM
At the end of your code, you have a for loop on direction/tuple (BTW, you shouldn't name a variable tuple, tuple is a built in function that is lost when you do that). Within that, you have a for loop on words. You want to reverse that: you want the first/outer loop to be on words, and the second/inner loop to be on direction/tuple.
Now, that means you are going to be calculating the string variable a lot more than you were. If that is a problem, I would recommend calculating all of the strings ahead of time. You have a dictionary of directions to tuples, just make one of direction to string. Then you can just access them from the dictionary each loop rather than recalculating them.
Now, that means you are going to be calculating the string variable a lot more than you were. If that is a problem, I would recommend calculating all of the strings ahead of time. You have a dictionary of directions to tuples, just make one of direction to string. Then you can just access them from the dictionary each loop rather than recalculating them.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures