def empezar(self):
        liR = []
        if self.fns and Util.existeFichero(self.fns):
            fns = self.fns.lower()
            li = []
            if fns.endswith(".pgn"):
                f = open(fns, "rb")
                for linea in f:
                    if linea.startswith("[FEN "):
                        li.append(linea[6:].split('"')[0])
                f.close()
            else:  # se supone que es un fichero de fens
                f = open(fns, "rb")
                for linea in f:
                    linea = linea.strip()
                    if linea[0].isalnum() and \
                            linea[-1].isdigit() and \
                            ( (" w " in linea) or (" b " in linea) ) and \
                                    linea.count("/") == 7:
                        li.append(linea)
                f.close()
            if len(li) >= self.pruebas:
                liR = random.sample(li, self.pruebas)
            else:
                self.fns = ""

        if not liR:
            liR = PantallaPotencia.leeVariasLineasMFN(self.pruebas)

        # liR = liFens
        w = WDailyTest(self, liR, self.motor, self.segundos, self.fns)
        w.exec_()
        self.calcListaHistorico()
        self.ghistorico.refresh()
    def empezar(self):
        liR = []
        if self.fns and Util.existeFichero(self.fns):
            fns = self.fns.lower()
            li = []
            if fns.endswith(".pgn"):
                f = open(fns, "rb")
                for linea in f:
                    if linea.startswith("[FEN "):
                        li.append(linea[6:].split('"')[0])
                f.close()
            else:  # se supone que es un fichero de fens
                f = open(fns, "rb")
                for linea in f:
                    linea = linea.strip()
                    if linea[0].isalnum() and \
                            linea[-1].isdigit() and \
                            ((" w " in linea) or (" b " in linea)) and \
                                    linea.count("/") == 7:
                        li.append(linea)
                f.close()
            if len(li) >= self.pruebas:
                liR = random.sample(li, self.pruebas)
            else:
                self.fns = ""

        if not liR:
            liR = PantallaPotencia.lee_varias_lineas_mfn(self.pruebas)

        # liR = liFens
        w = WDailyTest(self, liR, self.motor, self.segundos, self.fns)
        w.exec_()
        self.calcListaHistorico()
        self.ghistorico.refresh()
 def dameOtro(self):
     partida, dicPGN, info, jugadaInicial, linea = PantallaPotencia.leeLineaMFN()
     # Tenemos 10 jugadas validas desde jugadaInicial
     n = random.randint(jugadaInicial, jugadaInicial + 10 - self.nivel)
     fenIni = partida.jugada(n).posicionBase.fen()
     liMV = []
     for x in range(self.nivel):
         jg = partida.jugada(x + n)
         mv = jg.movimiento()
         liMV.append(mv)
     fenFin = partida.jugada(n + self.nivel).posicionBase.fen()
     return fenIni, fenFin, liMV, info
Exemple #4
0
 def dameOtro(self):
     partida, dicPGN, info, jugadaInicial, linea = PantallaPotencia.lee_linea_mfn()
     # Tenemos 10 jugadas validas desde jugadaInicial
     n = random.randint(jugadaInicial, jugadaInicial + 10 - self.nivel)
     fenIni = partida.jugada(n).posicionBase.fen()
     liMV = []
     for x in range(self.nivel):
         jg = partida.jugada(x + n)
         mv = jg.movimiento()
         liMV.append(mv)
     fenFin = partida.jugada(n + self.nivel).posicionBase.fen()
     return fenIni, fenFin, liMV, info
Exemple #5
0
 def dameOtro(self):
     game, dicPGN, info, jugadaInicial, linea = PantallaPotencia.lee_linea_mfn(
     )
     # Tenemos 10 num_moves validas from_sq jugadaInicial
     n = random.randint(jugadaInicial, jugadaInicial + 10 - self.nivel)
     fenIni = game.move(n).position_before.fen()
     liMV = []
     for x in range(self.nivel):
         move = game.move(x + n)
         mv = move.movimiento()
         liMV.append(mv)
     fenFin = game.move(n + self.nivel).position_before.fen()
     return fenIni, fenFin, liMV, info
Exemple #6
0
 def potencia(self):
     PantallaPotencia.pantallaPotencia(self.procesador)
Exemple #7
0
 def potencia(self):
     PantallaPotencia.pantallaPotencia(self.procesador)