示例#1
0
void brain_init()
{
  if(width<5 || height < 5){
    pipeOut("ERROR Invalid size of the board");
    return;
  }
  if(width > MAX_BOARD_SIZE || height>MAX_BOARD_SIZE){
    pipeOut("ERROR Maximal board size is %d", MAX_BOARD_SIZE);
    return;
  }
  brain_restart();
}
示例#2
0
void brain_init()
{
  if(width<5 || height < 5){
    pipeOut("ERROR Invalid size of the board");
    return;
  }
  if(width > MAX_BOARD_WIDTH){
    pipeOut("ERROR Maximal board width is %d", MAX_BOARD_WIDTH);
    return;
  }
  if(height > MAX_BOARD_HEIGHT){
    pipeOut("ERROR Maximal board height is %d", MAX_BOARD_HEIGHT);
    return;
  }
  brain_restart();
}
示例#3
0
void brain_turn()
{
  int x, y;
  ai->yourTurn(x, y);
  ai->move(x, y);
  pipeOut("%d,%d", x, y);
}
示例#4
0
void WriteLog(int points, int nSearched, int speed, int depth, bool debug)
{
  pipeOut("%s eval %d, depth %d, nodes %d, speed %d", debug ? "DEBUG" : "MESSAGE", 
    points, depth, nSearched, speed);
}
示例#5
0
void brain_restart()
{
  if(!ai) ai = new AICarbon();
  ai->start(width, height);
  pipeOut("OK");
}
示例#6
0
void brain_block(int x, int y)
{
  pipeOut("ERROR brain_block not implemented");
}