it seems really hard to read this part of my code and feels like there is a way to make it shorter so yea, i dont think context of the code matters if down: if ( ( start[0] , start[1] + index ) in matrix.keys() and matrix[( start[0] , start[1] + index )] != letter ): return False elif ( start[0] + index , start[1] ) in matrix.keys(): continue if (( start[0] , start[1] + index ) in matrix.keys() or ( start[0]-1 , start[1] + index ) in matrix.keys() or ( start[0]+1 , start[1] + index ) in matrix.keys() ): return False else: if( ( start[0] + index, start[1] ) in matrix.keys() and matrix[( start[0] + index, start[1] )] != letter ): return False elif ( start[0] + index , start[1] ) in matrix.keys(): continue elif (( start[0] + index , start[1] ) in matrix.keys() or ( start[0] + index , start[1]-1 ) in matrix.keys() or ( start[0] + index , start[1]+1 )in matrix.keys() ): return False` i dont really have idea of the way how i could improve thos code so i have not tried anything yet Continue reading...