Beispiel #1
0
    m.populateStates()

    for i, move in enumerate(m.moves):
        comment = ''

        #print "move.player is -%s-" % move.player

        if move.player == playerChar:
            boardState = ''
            boardStates = string.split(m.states[i], ' | ')
            if playerChar in "Aa":
                boardState = boardStates[0]
            else:
                boardState = boardStates[1]

            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "calling searchPossibilitiesBug(16, %s)" % boardState

            analysis = Sjeng.searchPossibilitiesBug(16, boardState)

            comment = '{\n%s\n}' % analysis

        print move, ' ', comment

    # repeat the last part of the BPGN
    #
    print ' ', m.tags['Result']
Beispiel #2
0
    
    for i, move in enumerate(m.moves):
        comment = ''

        #print "move.player is -%s-" % move.player

        if move.player == playerChar:
            boardState = ''
            boardStates = string.split(m.states[i], ' | ')
            if playerChar in "Aa":
                boardState = boardStates[0]
            else:
                boardState = boardStates[1]

            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "!!!!!!!!!!!!!!!!!!!"
            #print "calling searchPossibilitiesBug(16, %s)" % boardState

            analysis = Sjeng.searchPossibilitiesBug(16, boardState)
    
            comment = '{\n%s\n}' % analysis
    
        print move, ' ', comment
   
    # repeat the last part of the BPGN
    #
    print ' ', m.tags['Result']
    
Beispiel #3
0
                    continue

                (aState, bState) = string.split(s, ' | ')

                # is already seen? continue on
                for state in [aState, bState]:
                    print "considering state: %s" % state

                    curs.execute('select position from data where position=\"%s\"' % state)
                    row = curs.fetchone()
                    if row:
                        print "ALREADY SEEN THIS POSITION!"
                        continue

                    print "appealing to Sjeng..."
                    line = Sjeng.searchMate(8, state)

                    if line:
                        print "FOUND MATE! %s" % line
                    else:
                        line = ''

                    statement = "insert or replace into data values ('%s', '%s')" % (state, line)
                    print "executing SQL: %s" % statement
                    curs.execute(statement)
                    conn.commit()

        except Exception as e:
            print e
            print "shit", sys.exc_info()[0]
            print traceback.print_tb(sys.exc_traceback)
Beispiel #4
0
                (aState, bState) = string.split(s, ' | ')

                # is already seen? continue on
                for state in [aState, bState]:
                    print "considering state: %s" % state

                    curs.execute(
                        'select position from data where position=\"%s\"' %
                        state)
                    row = curs.fetchone()
                    if row:
                        print "ALREADY SEEN THIS POSITION!"
                        continue

                    print "appealing to Sjeng..."
                    line = Sjeng.searchMate(8, state)

                    if line:
                        print "FOUND MATE! %s" % line
                    else:
                        line = ''

                    statement = "insert or replace into data values ('%s', '%s')" % (
                        state, line)
                    print "executing SQL: %s" % statement
                    curs.execute(statement)
                    conn.commit()

        except Exception as e:
            print e
            print "shit", sys.exc_info()[0]