Ejemplo n.º 1
0
def check_blund():
    print()

    if game.ply + 1 in values and game.ply in values:
        color = game.ply % 2
        oldmoves, oldscore = values[game.ply]
        moves, score = values[game.ply + 1]
        dif = score - oldscore
        if dif < -100 and color == WHITE:
            print("White blunder", dif)
            print("Should have done:",
                  ", ".join(listToSan(game.getBoardAtPly(game.ply), oldmoves)))
            print()
        elif dif > 100 and color == BLACK:
            print("Black blunder", dif)
            print("Should have done:",
                  ", ".join(listToSan(game.getBoardAtPly(game.ply), oldmoves)))
            print()

    movename = toSAN(game.getBoardAtPly(game.ply - 1),
                     game.getMoveAtPly(game.ply - 1))
    if game.ply % 2 == 1:
        move_suffix = ""
    else:
        move_suffix = "..."
    print("Considering %d%s %s " % (
        (game.ply + 1) // 2,
        move_suffix,
        movename,
    ),
          end=' ')
    game.undoMoves(1)
Ejemplo n.º 2
0
def check_blund():
    print
    
    if game.ply+1 in values and game.ply in values:
        color = game.ply % 2
        oldmoves, oldscore = values[game.ply]
        moves, score = values[game.ply+1]
        dif = score-oldscore
        if dif < -100 and color == WHITE:
            print "White blunder", dif
            print "Should have done:", ", ".join(listToSan(game.getBoardAtPly(game.ply),oldmoves))
            print
        elif dif > 100 and color == BLACK:
            print "Black blunder", dif
            print "Should have done:", ", ".join(listToSan(game.getBoardAtPly(game.ply),oldmoves))
            print
    
    movename = toSAN(game.getBoardAtPly(game.ply-1),game.getMoveAtPly(game.ply-1))
    print "Considering", game.ply//2+1, movename, " ",
    game.undoMoves(1)
Ejemplo n.º 3
0
def check_blund():
    print

    if game.ply + 1 in values and game.ply in values:
        color = game.ply % 2
        oldmoves, oldscore = values[game.ply]
        moves, score = values[game.ply + 1]
        dif = score - oldscore
        if dif < -100 and color == WHITE:
            print "White blunder", dif
            print "Should have done:", ", ".join(
                listToSan(game.getBoardAtPly(game.ply), oldmoves))
            print
        elif dif > 100 and color == BLACK:
            print "Black blunder", dif
            print "Should have done:", ", ".join(
                listToSan(game.getBoardAtPly(game.ply), oldmoves))
            print

    movename = toSAN(game.getBoardAtPly(game.ply - 1),
                     game.getMoveAtPly(game.ply - 1))
    print "Considering", game.ply // 2 + 1, movename, " ",
    game.undoMoves(1)
Ejemplo n.º 4
0
def check_blund():
    print()
    
    if game.ply+1 in values and game.ply in values:
        color = game.ply % 2
        oldmoves, oldscore = values[game.ply]
        moves, score = values[game.ply+1]
        dif = score-oldscore
        if dif < -100 and color == WHITE:
            print("White blunder", dif)
            print("Should have done:", ", ".join(listToSan(game.getBoardAtPly(game.ply),oldmoves)))
            print()
        elif dif > 100 and color == BLACK:
            print("Black blunder", dif)
            print("Should have done:", ", ".join(listToSan(game.getBoardAtPly(game.ply),oldmoves)))
            print()
    
    movename = toSAN(game.getBoardAtPly(game.ply-1),game.getMoveAtPly(game.ply-1))
    if game.ply % 2 == 1:
        move_suffix = ""
    else:
        move_suffix = "..."
    print("Considering %d%s %s " % ((game.ply+1)//2, move_suffix, movename,), end=' ')
    game.undoMoves(1)