I am trying to create a checking program to see if the word is in a matrix horizontally or vertically. I have the code for checking the row, but would checking the column be similar to the row code?
def checkRow(table, r, pos, word):
for i in range(0, len(word)):
if table[r][pos+i] != word[i]:
return False
return True
a sample table would be like this:
[
[ a , p , p , l , e , b ],
[ u , y , c , v , a , s ],
[ n , u , t , o , n , s ],
[ t , n , c , v , d , b ],
[ o , r , i , x , o , f ],
[ e , a , t , i , n , g ]
]