예제 #1
0
파일: adp.py 프로젝트: IrohXu/Gomoku-XYH19
 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
파일: adp.py 프로젝트: IrohXu/Gomoku-XYH19
 def brain_about():
     pp.pipeOut('f**k')
예제 #13
0
파일: adp.py 프로젝트: IrohXu/Gomoku-XYH19
 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
파일: adp.py 프로젝트: IrohXu/Gomoku-XYH19
 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")