• 大小: 475KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-07
  • 语言: Java
  • 标签: java  五子棋  

资源简介

java五子棋,带有智能AI算法,实现人人对战,人机对战,AI分简单和困难。

资源截图

代码片段和文件信息

//判断输赢方法

package Interface;

public class check {
private static int[][] chesses;

public void setC(int[][] chesses) {
check.chesses = chesses;
}

public static int rule() {
int[] k = new int[8];
k[0] = k[1] = k[2] = k[3] = 1;
k[4] = k[5] = k[6] = k[7] = -1;
for (int i = 4; i < Config.COLUMNS; i++) {
for (int j = 0; j < Config.ROWS; j++) {
if (chesses[i][j] == 1) {
k[0] = chesses[i - 4][j] + chesses[i - 3][j]
+ chesses[i - 2][j] + chesses[i - 1][j]
+ k[0];
} else if (chesses[i][j] == -1) {
k[4] = chesses[i - 4][j] + chesses[i - 3][j ]
+ chesses[i - 2][j] + chesses[i - 1][j]
+ k[4];
}
if (k[0] == 5) {
return 1;
} else
k[0] = 1;
if (k[4] == -5)
return -1;
else

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-19 15:08  FiveChessUI\
     文件         299  2018-05-12 10:13  FiveChessUI\.classpath
     文件         387  2018-05-12 10:13  FiveChessUI\.project
     目录           0  2019-01-19 15:08  FiveChessUI\.settings\
     文件         598  2018-05-12 10:13  FiveChessUI\.settings\org.eclipse.jdt.core.prefs
     目录           0  2019-09-09 10:59  FiveChessUI\bin\
     目录           0  2019-09-09 10:59  FiveChessUI\bin\Interface\
     文件        1656  2019-09-09 10:59  FiveChessUI\bin\Interface\check.class
     文件         373  2019-09-09 10:59  FiveChessUI\bin\Interface\Chess.class
     文件        2978  2019-09-09 10:59  FiveChessUI\bin\Interface\ChessListener.class
     文件        1127  2019-09-09 10:59  FiveChessUI\bin\Interface\choose$1.class
     文件        1127  2019-09-09 10:59  FiveChessUI\bin\Interface\choose$2.class
     文件        1173  2019-09-09 10:59  FiveChessUI\bin\Interface\choose$3.class
     文件         825  2019-09-09 10:59  FiveChessUI\bin\Interface\choose$4.class
     文件        4018  2019-09-09 10:59  FiveChessUI\bin\Interface\choose.class
     文件        2784  2019-09-09 10:59  FiveChessUI\bin\Interface\color.class
     文件         281  2019-09-09 10:59  FiveChessUI\bin\Interface\Config.class
     文件       29768  2019-09-09 10:59  FiveChessUI\bin\Interface\Easy.class
     文件         979  2019-09-09 10:59  FiveChessUI\bin\Interface\FiveChessUI$1.class
     文件        1595  2019-09-09 10:59  FiveChessUI\bin\Interface\FiveChessUI$2.class
     文件        1104  2019-09-09 10:59  FiveChessUI\bin\Interface\FiveChessUI$3.class
     文件        5886  2019-09-09 10:59  FiveChessUI\bin\Interface\FiveChessUI.class
     文件       29722  2019-09-09 10:59  FiveChessUI\bin\Interface\Hard.class
     文件        1033  2019-09-09 10:59  FiveChessUI\bin\Interface\model$1.class
     文件        1044  2019-09-09 10:59  FiveChessUI\bin\Interface\model$2.class
     文件        3399  2019-09-09 10:59  FiveChessUI\bin\Interface\model.class
     文件        1335  2019-09-09 10:59  FiveChessUI\bin\Interface\MyArrayList.class
     文件        1343  2019-09-09 10:59  FiveChessUI\bin\Interface\Winner$1.class
     文件         876  2019-09-09 10:59  FiveChessUI\bin\Interface\Winner$2.class
     文件        2351  2019-09-09 10:59  FiveChessUI\bin\Interface\Winner.class
     目录           0  2019-09-09 10:59  FiveChessUI\bin\test\
............此处省略24个文件信息

评论

共有 条评论