三个白子连成串就提示白子赢了 最大值我已经射程5了
三个白子连成串就提示白子赢了 最大值我已经射程5了
三个白子连成串就提示白子赢了 最大值我已经射程5了
2016-04-01
//判断是否存在横向的5颗白(黑)棋 private boolean checkHorizontal(int x, int y, List<Point> points) { int count = 1; //向左 for (int i = 1; i < MAX_COUNT_IN_LINE; i++) { if (points.contains(new Point(x - i, y))) { count++; } else { break; } } if (count == MAX_COUNT_IN_LINE) return true; //向右 for (int i = 1; i < MAX_COUNT_IN_LINE; i++) { if (points.contains(new Point(x + i, y))) { count++; } else { break; } } if (count == MAX_COUNT_IN_LINE) return true; return false; }
举报