示例#1
0
 def brain_restart():
     board.reset()
     pp.pipeOut("OK")
def brain_opponents(x, y):
    if isFree(x, y):
        board[x][y] = 2
    else:
        pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
示例#3
0
def brain_restart():
    ai.start(pp.width, pp.height)
    pp.pipeOut("OK")
示例#4
0
def brain_opponents(x, y):
    if gomoku.is_free(x, y):
        gomoku.make_move(x, y, 2)
    else:
        pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
def brain_restart():
    for x in range(pp.width):
        for y in range(pp.height):
            board[x][y] = 0
    pp.pipeOut("OK")
def brain_block(x, y):
	if isFree(x, y):
		board.move(x, y, board.get_next_player())
	else:
		pp.pipeOut("ERROR winning move [{},{}]".format(x, y))
示例#7
0
def brain_restart():
    gomoku.restart()
    pp.pipeOut("OK")
示例#8
0
def brain_about():
    logDebug('brain_about()')
    pp.pipeOut(pp.infotext)
示例#9
0
文件: main.py 项目: ghqing0310/Gomoku
def brain_restart():
    """delete old board, create new board, call pipeOut("OK")"""
    for x in range(pp.width):
        for y in range(pp.height):
            board[x][y] = 0
    pp.pipeOut("OK")
示例#10
0
def brain_my(x, y):
    logDebug('my_move({},{})'.format(x, y))
    if isFree(x, y):
        board[x][y] = 1
    else:
        pp.pipeOut("ERROR my move [{},{}]".format(x, y))
示例#11
0
def brain_opponents(x, y):
    logDebug('opponent_move({},{})'.format(x, y))
    if isFree(x, y):
        board[x][y] = 2
    else:
        pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
示例#12
0
 def brain_about():
     pp.pipeOut('f**k')
示例#13
0
 def brain_block(x, y):
     if isFree(x, y):
         board[x][y] = 3
         logDebug('brain_block at (%s, %s)' % (x, y))
     else:
         pp.pipeOut("ERROR winning move [{},{}]".format(x, y))
示例#14
0
 def brain_opponents(x, y):  # 这个函数在对手胜利的那步不会被调用
     if isFree(x, y):
         main.run_opponent(x, y)
     else:
         pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
def brain_my(x, y):
	if isFree(x, y):
		board.move(x, y, board.get_next_player())
	else:
		pp.pipeOut("ERROR my move [{},{}]".format(x, y))
示例#16
0
文件: main.py 项目: ghqing0310/Gomoku
def brain_my(x, y):
    """put your move to the board"""
    if isFree(x, y):
        board[x][y] = 1
    else:
        pp.pipeOut("ERROR my move [{},{}]".format(x, y))
def brain_opponents(x, y):
	if isFree(x, y):
		board.move(x, y, board.get_next_player())
	else:
		pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
示例#18
0
文件: main.py 项目: ghqing0310/Gomoku
def brain_opponents(x, y):
    """put opponent's move to the board"""
    if isFree(x, y):
        board[x][y] = 2
    else:
        pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
示例#19
0
def brain_about():
    """
    Print copyright.
    """
    pp.pipeOut(pp.infotext)
示例#20
0
文件: main.py 项目: ghqing0310/Gomoku
def brain_block(x, y):
    """square [x,y] belongs to a winning line (when info_continuous is 1)"""
    if isFree(x, y):
        board[x][y] = 3
    else:
        pp.pipeOut("ERROR winning move [{},{}]".format(x, y))
示例#21
0
def brain_my(x, y):
    if gomoku.is_free(x, y):
        gomoku.make_move(x, y, 1)
    else:
        pp.pipeOut("ERROR my move [{},{}]".format(x, y))
示例#22
0
 def brain_restart():
     board.reset()
     uct.reset()
     global START_TIME
     START_TIME = time.time()
     pp.pipeOut("OK")
示例#23
0
def brain_block(x, y):
    if gomoku.is_free(x, y):
        gomoku.make_move(x, y, 3)
    else:
        pp.pipeOut("ERROR winning move [{},{}]".format(x, y))
示例#24
0
 def brain_opponents(x, y):
     if isFree(x, y):
         board[x][y] = 2
         uct.forward(action=((x, y), 2))
     else:
         pp.pipeOut("ERROR opponents's move [{},{}]".format(x, y))
def brain_my(x, y):
    if isFree(x, y):
        board[x][y] = 1
    else:
        pp.pipeOut("ERROR my move [{},{}]".format(x, y))
示例#26
0
def main():
	pp.pipeOut("OK")
	pp.main()
def brain_block(x, y):
    if isFree(x, y):
        board[x][y] = 3
    else:
        pp.pipeOut("ERROR winning move [{},{}]".format(x, y))
def brain_restart():
	global board, COMPUTER
	board = Board()
	COMPUTER = Computer()
	pp.pipeOut("OK")
示例#29
0
def brain_about():
    pp.pipeOut(pp.infotext)
示例#30
0
def brain_restart():
    logDebug('brain restart')
    gomoku.restart()
    pp.pipeOut("OK")