Пример #1
0
def main():
    scratch.init()
    scratch.newGame()
    scratch.printAll()

    scratch.simulateGame()
    scratch.postGameToTumblr()
Пример #2
0
def main():
    scratch.init()
    scratch.newGame()
    scratch.printAll()

    scratch.simulateGame()
    scratch.postGameToTumblr()
Пример #3
0
    def get_best_move(self, board, rack):
        print 'get_best_move'
        scratch.newGame()
        scratch.setBoard(board)
        scratch.setCurrentRack(rack)
        scratch.printAll()
        results = scratch.bestMove()

        pos = scratch.DirectedPosition(results[2][0], results[2][1], results[2][2])
        move = {}
        scratch.placeWord(move, pos.row, pos.col, pos.vert, results[1].upper())

        return move
Пример #4
0
    def get_best_move(self, board, rack):
        print 'get_best_move'
        scratch.newGame()
        scratch.setBoard(board)
        scratch.setCurrentRack(rack)
        scratch.printAll()
        results = scratch.bestMove()

        pos = scratch.DirectedPosition(results[2][0], results[2][1],
                                       results[2][2])
        move = {}
        scratch.placeWord(move, pos.row, pos.col, pos.vert, results[1].upper())

        return move