Im having problems indexing a 6x6 matrix in which i created through nested lists. The program is for a flipping tiles game if that helps for visualization. The matrix looks something like this:
[["word1","word2","word3,"word4","word5","word6"],["word7", ... etc]
with 6 rows and 6 elements in each row.
I would like to assign each word to an combination of two elements with the two lists ["A","B","C","D","E","F"]
on a (horizontal axis) and ["1","2","3","4","5","6"]
on a (vertical axis), for example "word1"
would be assigned to "A1"
. The word in question would then be accesed through an input from a user through this number/letter combination, so that i can change the matrix based on their input.
Right now i have some spaghetti code.
for i in range(6):
listVertical[0]+listHorizontal[i] == wordList[0[i]]
listVertical[1]+listHorizontal[i] == wordList[1[i]]
listVertical[2]+listHorizontal[i] == wordList[2[i]]
listVertical[3]+listHorizontal[i] == wordList[3[i]]
listVertical[4]+listHorizontal[i] == wordList[4[i]]
listVertical[5]+listHorizontal[i] == wordList[5[i]]
But im mainly wondering if this is even possible at all with the outline that i have right now or if i need to think of another way.
Its for a school project and the main help i found are through numpy and other libraries, which im not familiar with and not sure if we're allowed to use.