• 大小: 20.93MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-26
  • 语言: Java
  • 标签:

资源简介

支持网络三人斗地主。有一个服务器端,同时运行三个客户端并且连接服务器端的IP就可以联机游戏了。

资源截图

代码片段和文件信息

import java.util.ArrayList;
public class Compare
{
// public static ArrayList vector;
         int CardThree[][]=new int[4][21];//记录出牌的四种类型,一张,两张,三张,四张
         Sound music=new Sound();
public Compare()
{
        
}
public  int[] run(ArrayList vector)
{
 
            int n=vector.size();
            int[] cardrecord=new int[3]; //0记录牌是否合法;1;记录牌的类型 2,记录牌的大小
           for(int i=0;i<4;i++)
               for(int j=0;j<21;j++) {
             CardThree[i][j]=-1;
            }
            int[] PlayCard=new int [20];//转换为数组便于操作
            for(int i=0;i            {
                  PlayCard[i]=(Integer)vector.get(i)-1;
             }
            PanduanThree(n PlayCard);
            int panduan=PanduanTShunzi(nPlayCard);
            switch(n)
            {
                case 1:
                    
                            if(PlayCard[0]>52)
                         {
                              cardrecord[0]=1;
                              cardrecord[1]=1;
                              cardrecord[2]=PlayCard[0]/4+3+PlayCard[0]%4;
                              return cardrecord;
                         }
                            else
                         {
                              cardrecord[0]=1;
                              cardrecord[1]=1;
                              cardrecord[2]=PlayCard[0]/4+3;
                                return cardrecord;
                         }
                case 2:
                      
                            if(PlayCard[n-1]/4==13&&PlayCard[n-2]/4==13) 
                        {
                              cardrecord[0]=1;
                              cardrecord[1]=1;
                              cardrecord[2]=17;    
                           
                                return cardrecord;
                        }
                             else if(PlayCard[n-1]/4==PlayCard[n-2]/4&&PlayCard[n-2]/4!=13)
                        {
                             cardrecord[0]=1;
                             cardrecord[1]=2;
                             cardrecord[2]=CardThree[1][0];   
                           
                                return cardrecord;
                        }
                            else 
                                return cardrecord;
                     
                case 3:
                           if(PlayCard[n-1]/4==PlayCard[n-2]/4&&PlayCard[n-3]/4==PlayCard[n-2]/4) 
                        {
                             cardrecord[0]=1;
                             cardrecord[1]=1;
                             cardrecord[2]=CardThree[2][0];        
                                return cardrecord;
                         }
                            else
                                return cardrecord;
                case 4:

                      if(CardThree[0][0]!=-1&&CardThree[2][0]!=-1) 
                        {  
         

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-10-21 10:50  Game\
     目录           0  2012-10-31 20:16  Game\Client\
     文件        1045  2012-10-19 21:05  Game\Client\Client.bat
     文件          53  2012-10-19 20:09  Game\Client\compile.bat
     文件          28  2012-10-10 22:22  Game\Client\del.bat
     文件         959  2012-10-31 20:18  Game\Client\Game_Test_Explain(说明).bat
     目录           0  2012-10-21 12:27  Game\Client\src\
     文件        5509  2012-10-21 12:21  Game\Client\src\Compare.class
     文件       17955  2012-10-19 20:06  Game\Client\src\Compare.java
     文件         815  2012-10-21 12:21  Game\Client\src\DealCard$1.class
     文件        5746  2012-10-21 12:21  Game\Client\src\DealCard.class
     文件       14995  2012-10-19 20:06  Game\Client\src\DealCard.java
     文件         234  2012-10-21 12:21  Game\Client\src\DealLabel.class
     文件         142  2012-10-19 20:05  Game\Client\src\DealLabel.java
     文件        1315  2012-10-21 12:21  Game\Client\src\Guize.class
     文件        1994  2012-10-19 20:06  Game\Client\src\Guize.java
     文件       12239  2012-10-21 12:21  Game\Client\src\hs_err_pid11756.log
     文件       11919  2012-10-21 12:22  Game\Client\src\hs_err_pid4304.log
     文件         941  2012-10-21 12:21  Game\Client\src\MainClient$1.class
     文件       19277  2012-10-21 12:21  Game\Client\src\MainClient.class
     文件       29943  2012-10-21 12:15  Game\Client\src\MainClient.java
     文件         997  2012-10-21 14:55  Game\Client\src\MainTest.class
     文件        1308  2012-10-20 18:46  Game\Client\src\MainTest.java
     文件         843  2012-10-21 12:28  Game\Client\src\Sound$1.class
     文件        1297  2012-10-21 12:28  Game\Client\src\Sound.class
     文件        1295  2012-10-21 12:28  Game\Client\src\Sound.java
     文件        1291  2012-10-21 12:27  Game\Client\src\Sound.java.bak
     目录           0  2012-10-21 11:41  Game\Client\src\tupian\
     文件       22466  2012-09-26 20:18  Game\Client\src\tupian\0.jpg
     文件        3650  2012-07-27 22:15  Game\Client\src\tupian\1.jpg
     文件        4951  2012-07-27 22:15  Game\Client\src\tupian\10.jpg
............此处省略130个文件信息

评论

共有 条评论

相关资源