void othello_ai::init(int color, string s){ o.init(color, s);//让sdk初始化局面 cost[0][0] = 9; cost[0][15] = 9; cost[15][0] = 9; cost[15][15] = 9; int i; int j; for(i = 2 ;i < 14 ; i ++) { cost[0][i] = 4; cost[i][0] = 4; cost[15][i] = 4; cost[i][15] = 4; } for(i = 0; i < 16; i ++) { cost[1][i] = -2; cost[14][i] = -2; cost[i][1] = -2; cost[i][14] = -2; } cost[1][1] = -20; cost[1][0] = -20; cost[0][1] = -20; cost[0][14] = -20; cost[1][14] = -20; cost[1][15] = -20; cost[14][0] = -20; cost[14][1] = -20; cost[15][1] = -20; cost[14][15] = -20; cost[14][14] = -20; cost[15][14] = -20; for(i = 2 ; i < 14; i ++) for(j = 2 ; j < 14 ; j ++) cost[i][j] = 1; }
//初始化阶段,告知你所执子的颜色,和当前棋盘落子情况s void othello_ai::init(int color, std::string s){ o.init(color, s); init_valuemap(); std::cerr<<"My color is "<<o.mycolor<<std::endl; }