Exemplo n.º 1
0
 def __crear_grilla_horizontal(self,graph,mayus):
     matriz = self.__distribuir_palabras()
     print(matriz)
     '''
      Distribuye las palabras por la grilla. METODO PRIVADO
     '''
     dic = dict()
     dicAux = dict()
     y1 = 0
     y2 = 25
     for z in range(len(matriz)):    #cantidad de filas de la matriz
         _x1 = 0
         x2 = 25
         for n in range(len(matriz[z])):     #cantidad de columnas
             pos_sup = (_x1,y1)
             pos_inf = (x2,y2)
             cell = Celda()
             cell.set_coordenada_sup(pos_sup)
             cell.set_coordenada_inf(pos_inf)
             if(mayus == 'Mayuscula'):
                 cell.set_letra(matriz[z][n].upper())
             else:
                 cell.set_letra(matriz[z][n].lower())
             cell.draw_cell(graph)
             self.__dic[(z,n)] = cell
             _x1+=25
             x2+=25
         y1+=25
         y2+=25
Exemplo n.º 2
0
 def __crear_grilla_vertical(self, graph, mayus):
     '''
         Distribuye las palabras por la grilla. METODO PRIVADO
     '''
     matriz = self.__distribuir_palabras()
     _x1 = 0
     x2 = 25
     for z in range(len(matriz)):  #cantidad de columnas
         y1 = 0
         y2 = 25
         for n in range(len(matriz[z])):  #cantidad de filas
             pos_sup = (_x1, y1)
             pos_inf = (x2, y2)
             cell = Celda()
             cell.set_coordenada_sup(pos_sup)
             cell.set_coordenada_inf(pos_inf)
             if (mayus == 'Mayuscula'):
                 cell.set_letra(matriz[z][n].upper())
             else:
                 cell.set_letra(matriz[z][n].lower())
             cell.draw_cell(graph)
             self.__dic[(n, z)] = cell
             y1 += 25
             y2 += 25
         _x1 += 25
         x2 += 25