コード例 #1
0
def main():

  mark_amy = ProductGameBoard(
      StormMySQLTranspositionTable('mysql://productgame@localhost/productgame'))
  mark_amy.make_move(ProductGameMove(6, 3)) #A
#  mark_amy.make_move(ProductGameMove(7, 3))
#  mark_amy.make_move(ProductGameMove(7, 4))
#  mark_amy.make_move(ProductGameMove(8, 4))
#  mark_amy.make_move(ProductGameMove(8, 6))
#  mark_amy.make_move(ProductGameMove(7, 6))
#  mark_amy.make_move(ProductGameMove(5, 6))
# After this point O thinks he will lose by move 15
#  mark_amy.make_move(ProductGameMove(6, 6))
#  mark_amy.make_move(ProductGameMove(6, 9))
#  mark_amy.make_move(ProductGameMove(9, 9))
#  mark_amy.make_move(ProductGameMove(9, 8))
#  mark_amy.make_move(ProductGameMove(1, 8))
#  mark_amy.make_move(ProductGameMove(2, 8))
#  mark_amy.make_move(ProductGameMove(2, 6))
#  mark_amy.make_move(ProductGameMove(4, 6))
# After this point O thinks he will lose by move 29
#  mark_amy.make_move(ProductGameMove(4, 1))
#  mark_amy.make_move(ProductGameMove(5, 1))
#  mark_amy.make_move(ProductGameMove(5, 9))
#  mark_amy.make_move(ProductGameMove(5, 8))
#  mark_amy.make_move(ProductGameMove(5, 4))
#  mark_amy.make_move(ProductGameMove(5, 2))
#  mark_amy.make_move(ProductGameMove(1, 2))
#  mark_amy.make_move(ProductGameMove(1, 3))

  mark_amy.ai_deadline=60*3
  mark_amy.is_automated[NegamarkBoard.X] = False
  mark_amy.is_automated[NegamarkBoard.O] = True

  mark_amy.choose_ai_move()
コード例 #2
0
def main():

    mark_amy = ProductGameBoard(StormTranspositionTable("sqlite:product_game_storm.db"))
    mark_amy.make_move(ProductGameMove(6, 3))  # A
    mark_amy.make_move(ProductGameMove(7, 3))
    mark_amy.make_move(ProductGameMove(7, 4))
    mark_amy.make_move(ProductGameMove(8, 4))
    mark_amy.make_move(ProductGameMove(8, 6))

    mark_amy.ai_deadline = 60
    mark_amy.is_automated[NegamarkBoard.X] = False
    mark_amy.is_automated[NegamarkBoard.O] = True

    #  mark_amy.play_game()
    mark_amy.choose_ai_move()