• 大小: 0.17M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-03-26
  • 语言: Java
  • 标签: java  

资源简介


java编写的带AI的智能五子棋,电脑能够先手后手,对五子棋热衷的朋友能够喜欢,AI还有不足需要改进,改进继续共享給大家

资源截图

代码片段和文件信息

public class AutoPlay{
     int xy;
     void autoPlay(int chesspad[][]int aint b){
          int randomNumber=(int)(Math.random()*8)+1;
          switch(randomNumber){
             case(1):
                  if(a-1>0 && b-1>0&&chesspad[a-1][b-1]==0)
                  {x=a-1;y=b-1;break;}
                  else if(a-2>0 && b-2>0&&chesspad[a-2][b-2]==0)
                  {x=a-2;y=b-2;break;} 
                  else{}
                  
                   
             case(2):
                  if(a-1>0 &&chesspad[a-1][b]==0)
                  {x=a-1;y=b;break;}
                  else if(a-2>0&&chesspad[a-2][b]==0)
                  {x=a-2;y=b;break;}
                  else{}
             case(3):
                  if(a-1>0 && b+1<=15&&chesspad[a-1][b+1]==0)
                  {x=a-1;y=b+1;break;}
                  else if(a-2>0 &&b+2<=15&&chesspad[a-2][b+2]==0)
                  {x=a-2;y=b+2;break;}
                  else{}
             case(4):
            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        385  2008-10-13 18:07  FiveStone\.project

     文件        226  2008-10-13 18:07  FiveStone\.classpath

     文件      12112  2008-10-21 15:34  FiveStone\FiveStone.java

     文件        141  2008-10-13 18:17  FiveStone\java.policy.applet

     文件         96  2008-10-13 18:37  FiveStone\FiveStone1223894264640.html

     文件         48  2008-10-14 09:42  FiveStone\manifest.mf

     文件       1314  2003-05-08 22:06  FiveStone\003.gif

     文件       1508  2003-05-09 17:45  FiveStone\004.gif

     文件     412612  2008-05-02 20:06  FiveStone\chessboard.bmp

     文件       1963  2008-10-16 09:22  FiveStone\Evaluate.java

     文件       1659  2008-10-16 09:22  FiveStone\Scan.java

     文件        516  2008-10-16 09:22  FiveStone\Sort.java

     文件       2225  2008-10-16 09:57  FiveStone\AutoPlay.java

     文件         48  2008-10-14 09:42  FiveStone\meta-INF\MANIFEST.MF

     文件        587  2008-10-21 14:45  FiveStone\Sort.class

     文件       1067  2008-10-21 14:45  FiveStone\Scan.class

     文件       9893  2008-10-21 15:34  FiveStone\FiveStone.class

     文件       1072  2008-10-21 14:45  FiveStone\Evaluate.class

     文件       1303  2008-10-21 14:45  FiveStone\AutoPlay.class

     文件       8133  2008-10-21 15:47  FiveStone\五子棋.jar

     目录          0  2008-10-16 08:38  FiveStone\meta-INF

     目录          0  2008-10-16 08:38  FiveStone

----------- ---------  ---------- -----  ----

               456908                    22


评论

共有 条评论