< this.chessboard.length) {position[2] = this.chessboard[x + 1][y];} else {position[2] = 0;}if (x + 2 < this.chessboard.length) {position[3] = this.chessboard[x + 2][y];} else {position[3] = 0;}int sum = 0;sum += calculate(position);return sum;}// 上下方向评分private int mark2(int x, int y) {int[] position = new int[4];if (y - 2 >= 0) {position[0] = this.chessboard[x][y - 2];} else {position[0] = 0;}if (y - 1 >= 0) {position[1] = this.chessboard[x][y - 1];} else {position[1] = 0;}if (y + 1 < this.chessboard.length) {position[2] = this.chessboard[x][y + 1];} else {position[2] = 0;}if (y + 2 < this.chessboard.length) {position[3] = this.chessboard[x][y + 2];} else {position[3] = 0;}int sum = 0;sum += calculate(position);return sum;}// 主对角线方向评分private int mark3(int x, int y) {int[] position = new int[4];if (x - 2 >= 0 && y - 2 >= 0) {position[0] = this.chessboard[x - 2][y - 2];} else {position[0] = 0;}if (x - 1 >= 0 && y - 1 >= 0) {position[1] = this.chessboard[x - 1][y - 1];} else {position[1] = 0;}if (x + 1 < this.chessboard.length && y + 1 < this.chessboard.length) {position[2] = this.chessboard[x + 1][y + 1];} else {position[2] = 0;}if (x + 2 < this.chessboard.length && y + 2 < this.chessboard.length) {position[3] = this.chessboard[x + 2][y + 2];} else {position[3] = 0;}int sum = 0;sum += calculate(position);return sum;}// 副对角线方向评分private int mark4(int x, int y) {int[] position = new int[4];if (x - 2 >= 0 && y + 2 < this.chessboard.length) {position[0] = this.chessboard[x - 2][y + 2];} else {position[0] = 0;}if (x - 1 >= 0 && y + 1 < this.chessboard.length) {position[1] = this.chessboard[x - 1][y + 1];} else {position[1] = 0;}if (x + 1 < this.chessboard.length && y - 1 >= 0) {position[2] = this.chessboard[x + 1][y - 1];} else {position[2] = 0;}if (x + 2 < this.chessboard.length && y - 2 >= 0) {position[3] = this.chessboard[x + 2][y - 2];} else {position[3] = 0;}int sum = 0;sum += calculate(position);return sum;}// 八个方向评分private int mark5(int x, int y) {int sum = 0;int[] position = new int[4];// 上方向if (x - 1 >= 0) {position[0] = this.chessboard[x - 1][y];} else {position[0] = 0;}if (x - 2 >= 0) {position[1] = this.chessboard[x - 2][y];} else {position[1] = 0;}if (x - 3 >= 0) {position[2] = this.chessboard[x - 3][y];} else {position[2] = 0;}if (x - 4 >= 0) {position[3] = this.chessboard[x - 4][y];} else {position[3] = 0;}sum += calculate2(position);// 下方向if (x + 1 < this.chessboard.length) {position[0] = this.chessboard[x + 1][y];} else {position[0] = 0;}if (x + 2 < this.chessboard.length) {position[1] = this.chessboard[x + 2][y];} else {position[1] = 0;}if (x + 3 < this.chessboard.length) {position[2] = this.chessboard[x + 3][y];} else {position[2] = 0;}if (x + 4 < this.chessboard.length) {position[3] = this.chessboard[x + 4][y];} else {position[3] = 0;}sum += calculate2(position);// 左方向if (y - 1 >= 0) {position[0] = this.chessboard[x][y - 1];} else {position[0] = 0;}if (y - 2 >= 0) {position[1] = this.chessboard[x][y - 2];} else {position[1] = 0;}if (y - 3 >= 0) {position[2] = this.chessboard[x][y - 3];} else {position[2] = 0;}if (y - 4 >= 0) {position[3] = this.chessboard[x][y - 4];} else {position[3] = 0;}sum += calculate2(position);// 右方向if (y + 1 < this.chessboard.length) {position[0] = this.chessboard[x][y + 1];} else {position[0] = 0;}if (y + 2 < this.chessboard.length) {position[1] = this.chessboard[x][y + 2];} else {position[1] = 0;}if (y + 3 < this.chessboard.length) {position[2] = this.chessboard[x][y + 3];} else {position[2] = 0;}if (y + 4 < this.chessboard.length) {position[3] = this.chessboard[x][y + 4];} else {position[3] = 0;}sum += calculate2(position);// 左斜上方向if (x - 1 >= 0 && y - 1 >= 0) {position[0] = this.chessboard[x - 1][y - 1];} else {position[0] = 0;}if (x - 2 >= 0 && y - 2 >= 0) {position[1] = this.chessboard[x - 2][y - 2];} else {position[1] = 0;}if (x - 3 >= 0 && y - 3 >= 0) {position[2] = this.chessboard[x - 3][y - 3];} else {position[2] = 0;}if (x - 4 >= 0 && y - 4 >= 0) {position[3] = this.chessboard[x - 4][y - 4];} else {position[3] = 0;}sum += calculate2(position);// 左斜下方向if (x + 1
- 最后一战手游登陆流程
- 蓝屏代码0x000000f4 蓝屏代码0x0000024
- 程序员小姐姐写出代码版《本草纲目》毽子操,刘畊宏回复:很cool!
- 机构信用代码证丢失 机构信用代码证丢失如何补办
- java编写的西洋跳棋小游戏,功能完善 界面漂亮 完整代码
- Spring MVC代码实例系列
- 这个YouTube博主玩无人机接乒乓球一年赚了1个亿
- 看科比特如何成为工业级无人机新标杆
- [开发环境]支持MASM代码汇编开发环境,支持32位和64位XP/7/8
- 一 YOLOv3:Darknet代码解析安装Darknet