for line in inTgtFile:
    outTgtFile.write(line)

boardInfoObj = BoardInfo()
for line in inSrcFile:
    words = line.split()
    print words
    #outSrcFile.write(line[index+6:])
    #print words
    EOPIndex = words.index("<EOP>")
    EOCIndex = words.index("<EOC>")
    currentBoard = words[:EOCIndex]
    previousBoard = words[EOCIndex + 1:EOPIndex]
    playerToMove = words[EOPIndex + 1]
    playerToMoveNext = boardInfoObj.complement(playerToMove)
    #print playerToMove
    squareToMove = words[EOPIndex + 4]
    #print squareToMove
    squareToMoveTo = words[EOPIndex + 5]
    #print squareToMoveTo
    moveColor = None
    moveColorNext = None
    if playerToMove == "black":
        moveColor = "b"
        moveColorNext = "w"
    else:
        moveColor = "w"
        moveColorNext = "b"
    #print currentBoard
    #print previousBoard
Exemplo n.º 2
0
for line in inTgtFile:
    outTgtFile.write(line)

boardInfoObj = BoardInfo(initEngine=True)
for line in inSrcFile:
    words = line.split()
    print(words)
    # outSrcFile.write(line[index+6:])
    # print words
    EOPIndex = words.index("<EOP>")
    EOCIndex = words.index("<EOC>")
    currentBoard = words[:EOCIndex]
    previousBoard = words[EOCIndex + 1:EOPIndex]
    playerToMove = words[EOPIndex + 1]
    playerToMoveNext = boardInfoObj.complement(playerToMove)
    # print playerToMove
    squareToMove = words[EOPIndex + 4]
    # print squareToMove
    squareToMoveTo = words[EOPIndex + 5]
    # print squareToMoveTo
    moveColor = None
    moveColorNext = None
    if playerToMove == "black":
        moveColor = "b"
        moveColorNext = "w"
    else:
        moveColor = "w"
        moveColorNext = "b"
    # print currentBoard
    # print previousBoard