石头剪刀布人机对战

一.使用说明

1.“构造规律展示区”仅仅记录“智能算法区”的“石头”、“剪刀”、“布”三个按钮,目的是让用户自己构造稍有规律的出拳序列,方便用户按照“智能算法区”自己构造的出拳序列去点击“随机算法区”的石头”、“剪刀”、“布”三个按钮,以对比两个算法的优劣。

2.“智能算法区”的“随机生成”按钮中,人使用了随机算法,计算机使用了智能算法;而“随机算法区”的“随机生成”按钮中,人和计算机同时使用了随机算法。

二.程序的适用范围

本程序的智能算法,在每一拳都谨慎思考,并总结失败的玩家身上,更能体现智能算法的优势。

对于完全不经思考,快速出拳的玩家,由于随机性太大,算法的优势不明显。当盘数超过200时,胜、败率呈现统计学规律,基本稳定在0.30—0.36之间。

三.推测

1.经过人类意识作用的社会活动,基本上会呈现出某种规律。即人的意识是有规律,有模式可循的。根据每个人的思考习惯不同而不相同;

2.人思考的时间越长,是否规律性越强?

3.人的潜意识是否也存在规律或者模式?



package jiandaoshitoubu;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class jiandaoshitoubu {
	
	public static void main(String[] args) {
	GameFrame gf = new GameFrame();
	gf.setVisible(true);
	
	}

}

class GameFrame extends JFrame implements ActionListener{

	private static final long serialVersionUID = -7985988417690464374L;
	private int result,ren;
	public JTextArea jtext= new JTextArea(28,28);
	public JTextArea jtext2= new JTextArea(28,28);
	public JTextArea jtext3= new JTextArea(24,32);
	
	int sum=0,sum_ying=0,sum_shu=0;
	int[] xulie_ren = new int[1000];
	
	public GameFrame(){
		try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch (ClassNotFoundException e2) {
			e2.printStackTrace();
		} catch (InstantiationException e2) {
			e2.printStackTrace();
		} catch (IllegalAccessException e2) {
			e2.printStackTrace();
		} catch (UnsupportedLookAndFeelException e2) {
			e2.printStackTrace();
		}
	    SwingUtilities.updateComponentTreeUI(this);
		this.setTitle("剪刀石头布");

		setSize(1000,600); 
        this.setResizable(true);   
        setLocation(160,100);  
        JMenuBar mbar = new JMenuBar();  
        this.setJMenuBar(mbar);  
        JMenu gameMenu = new JMenu("游戏");  
        mbar.add(makeMenu(gameMenu, new Object[] {  
            "开始","清除右边两个框的内容", null,"退出"  
                       }, this));  
        JMenu lookMenu =new JMenu("视图");  
        mbar.add(makeMenu(lookMenu,new Object[] {  
            "Metal","Motif","Windows"  
                       },this));  
        JMenu helpMenu = new JMenu("帮助");  
        mbar.add(makeMenu(helpMenu, new Object[] {  
            "关于"  
                        }, this));
		
        JPanel gridPanel = new JPanel();
        gridPanel.setLayout(new GridLayout(1,3));
        JPanel Jpanel1 = new JPanel();
        JPanel Jpanel2 = new JPanel();
        JPanel Jpanel3 = new JPanel();
        gridPanel.add(Jpanel1);
        gridPanel.add(Jpanel2);
        gridPanel.add(Jpanel3);
        
        JLabel jlabel = new JLabel("                                                                                 智能算法区                                                                                   ");
        JButton jButtonJiandao = new JButton("剪刀");
        JButton jButtonShitou = new JButton("石头");
        JButton jButtonBu = new JButton("布");
        JButton jButton100 = new JButton("随机生成100盘");
        JButton jButton50 = new JButton("随机生成50盘");
        JButton jButton200 = new JButton("随机生成200盘");
        JButton jButton500 = new JButton("随机生成500盘");
        JButton jButton1000 = new JButton("随机生成1000盘");
        JLabel jlabel2 = new JLabel("                                                                                 随机算法区                                                                                   ");
        JButton jButtonJiandaor = new JButton("剪刀");
        JButton jButtonShitour = new JButton("石头");
        JButton jButtonBur = new JButton("布");
        JButton jButton100r = new JButton("随机生成100盘");
        JButton jButton50r = new JButton("随机生成50盘");
        JButton jButton200r = new JButton("随机生成200盘");
        JButton jButton500r = new JButton("随机生成500盘");
        JButton jButton1000r = new JButton("随机生成1000盘");
        JLabel jlabel3 = new JLabel("                                                                                 构造规律展示区                                                                                   ");
        Jpanel1.add(jlabel);
        Jpanel1.add(jButtonJiandao);
        Jpanel1.add(jButtonShitou);
        Jpanel1.add(jButtonBu);
        Jpanel1.add(jButton50);
        Jpanel1.add(jButton100);
        Jpanel1.add(jButton200);
        Jpanel1.add(jButton500);
        Jpanel1.add(jButton1000);
        Jpanel1.add(jlabel2);
        Jpanel1.add(jButtonJiandaor);
        Jpanel1.add(jButtonShitour);
        Jpanel1.add(jButtonBur);
        Jpanel1.add(jButton50r);
        Jpanel1.add(jButton100r);
        Jpanel1.add(jButton200r);
        Jpanel1.add(jButton500r);
        Jpanel1.add(jButton1000r);
        Jpanel1.add(jlabel3);
        Jpanel1.add(jtext3);
        jButtonJiandao.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=0;
	        	xulie_ren[sum]= 0;
	        	sum++;
	        	result=Algroithm();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	jtext3.append("剪刀—>");
	        }            
	    });
        jButtonShitou.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=1;
	        	xulie_ren[sum]= 1;
	        	sum++;
	        	result=Algroithm();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	jtext3.append("石头—>");
	        }            
	    });
        jButtonBu.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=2;
	        	xulie_ren[sum]= 2;
	        	sum++;
	        	result=Algroithm();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	jtext3.append("布—>");
	        }            
	    });
        jButton50.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[50];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<50;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton100.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[100];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<100;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton200.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[200];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<200;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton500.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[500];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<500;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton1000.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[1000];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<1000;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        
  /*==================================华丽的分割线=========================================*/      
        
        jButtonJiandaor.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=0;
	        	xulie_ren[sum]= 0;
	        	sum++;
	        	result=Algroithm_random();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        }            
	    });
        jButtonShitour.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=1;
	        	xulie_ren[sum]= 1;
	        	sum++;
	        	result=Algroithm_random();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        }            
	    });
        jButtonBur.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	ren=2;
	        	xulie_ren[sum]= 2;
	        	sum++;
	        	result=Algroithm_random();
	        	judge(result,ren);
	        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        }            
	    });
        jButton50r.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[50];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<50;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm_random();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton100r.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[100];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<100;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm_random();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton200r.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[200];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<200;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm_random();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton500r.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[500];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<500;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm_random();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jButton1000r.addActionListener(new ActionListener() {
	        public void actionPerformed(ActionEvent e) {
	        	sum=0;sum_ying=0;sum_shu=0;
	        	try {
					finalize();
				} catch (Throwable e1) {
					e1.printStackTrace();
				}
	        	int[] xulie_ren = new int[1000];
	        	jtext.setText("");
	        	jtext2.setText("");
	        	for(int n=0;n<1000;n++)
	        	{
	        		int number = new Random().nextInt(3);
	        		ren=number;
		        	xulie_ren[sum]= number;
		        	sum++;
		        	result=Algroithm_random();
		        	judge(result,ren);
		        	jtext2.append(sum+":此时,您的胜率为"+String.format("%.2f",(double)sum_ying/sum)+";计算机的胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        	}
	        }            
	    });
        jtext.setLineWrap(true);
        Font x = new Font("黑体",1,18);
        jtext.setFont(x);
        JScrollPane scroll=new JScrollPane(jtext);
        scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
        scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        jtext.setCaretPosition(jtext.getText().length());
        Jpanel2.add(scroll);
   
		jtext2.setLineWrap(true);
        Font x2 = new Font("黑体",1,18);
        jtext2.setFont(x2);
        JScrollPane scroll2=new JScrollPane(jtext2);
        scroll2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
        scroll2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        jtext2.setCaretPosition(jtext2.getText().length());
        Jpanel3.add(scroll2);
        
        jtext3.setLineWrap(true);
        Font x3 = new Font("黑体",1,14);
        jtext3.setFont(x3);
        JScrollPane scroll3=new JScrollPane(jtext3);
        scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
        scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        jtext3.setCaretPosition(jtext3.getText().length());
        Jpanel1.add(scroll3);
        
        add(gridPanel,BorderLayout.CENTER);
	}
	
	public void judge(int count,int ren)
	{
		if((count == 0 && ren ==0)||(count == 1 && ren ==1)||(count == 2 && ren ==2))  //剪刀
		{
			if(count == 0)
				jtext.append(sum+":平局。你出的剪刀,计算机出的也是剪刀。"+"\n");
			else if(count == 1)
				jtext.append(sum+":平局。你出的石头,计算机出的也是石头。"+"\n");
			else
				jtext.append(sum+":平局。你出的布,计算机出的也是布。"+"\n");
		}
		else if(count == 0 && ren == 1)
		{
			jtext.append(sum+":你赢了。你出的石头,计算机出的是剪刀。"+"\n");
			sum_ying++;
		}
		else if(count == 0 && ren == 2)
		{
			jtext.append(sum+":你输了。你出的布,计算机出的是剪刀。"+"\n");
			sum_shu++;
		}
		else if(count == 1 && ren == 2)
		{
			jtext.append(sum+":你赢了。你出的布,计算机出的是石头。"+"\n");
			sum_ying++;
		}
		else if(count == 1 && ren == 0)
		{
			jtext.append(sum+":你输了。你出的剪刀,计算机出的是石头。"+"\n");
			sum_shu++;
		}
		else if(count == 2 && ren == 0)
		{
			jtext.append(sum+":你赢了。你出的剪刀,计算机出的是布。"+"\n");
			sum_ying++;
		}
		else if(count == 2 && ren == 1)
		{
			jtext.append(sum+":你输了。你出的石头,计算机出的是布。"+"\n");
			sum_shu++;
		}
	}
	
	public int Algroithm_random()  //石头剪刀布核心算法
	{
		int number = new Random().nextInt(3);
		return number;
	}
	
	public int Algroithm()  //石头剪刀布核心算法
	{
		if(sum == 1 || sum ==2)
		{
			int number = new Random().nextInt(3);
			return number;
		}
		else
		{
			for(int n=2;sum-n>0;n++)
			{
				//长度为n模式下的预测
				if(search(n)==0)  //下一把预测人出剪刀的概率大于0.5
					return 1;
				else if(search(n)==1)//下一把预测人出石头的概率大于0.5
					return 2;
				else if(search(n)==2)//下一把预测人出布的概率大于0.5
					return 0;
				else if(search(n)==-1)//当前字符含本身的前n-1字符串在其本身之前不存在
				{
					int number = new Random().nextInt(3);
					return number;
				}	
				else//下一把预测人的拳型中没有大于0.5的拳型
					continue;
			}
			int number = new Random().nextInt(3);
			return number;
		}
	}
	
	public int search(int len)
	{
		int jiandao=0,shitou=0,bu=0,sum1;
		for(int i=0;i<=sum-1-len;i++)
		{
			int j;
			for(j=0;j0.5)
			return 0;
		if((double)(shitou/sum1)>0.5)
			return 1;
		if((double)(bu/sum1)>0.5)
			return 2;
		return -2;
		
	}
	
	public  JMenu makeMenu(Object parent, Object items[], Object target)
    {
        JMenu m = null;
        if(parent instanceof JMenu)
            m = (JMenu)parent;
        else if(parent instanceof String)
            m = new JMenu((String)parent);
        else
        	return null;
        for(int i = 0; i < items.length; i++)
            if(items[i] == null)
            	m.addSeparator();
           else
        	   m.add(makeMenuItem(items[i], target));
           return m;
    }
	
	public  JMenuItem makeMenuItem(Object item, Object target){
        JMenuItem r = null;
        if(item instanceof String)
           r = new JMenuItem((String)item);
       else if(item instanceof JMenuItem)
           r = (JMenuItem)item;
       else
                return null;
        if(target instanceof ActionListener)
            r.addActionListener((ActionListener)target);
        return r;
    }
	
	//构造剪刀石头布游戏的单选按钮式菜单项
    public  JRadioButtonMenuItem makeRadioButtonMenuItem(
     Object item, Object target){
      JRadioButtonMenuItem r = null;
      if(item instanceof String)
         r = new JRadioButtonMenuItem((String)item);
     else if(item instanceof JRadioButtonMenuItem)
         r = (JRadioButtonMenuItem)item;
      else
      	           return null;
      if(target instanceof ActionListener)
         r.addActionListener((ActionListener)target);
     return r;
    }
    
    public void restart(){
      
     }
    
    public void actionPerformed(ActionEvent e){
        String arg=e.getActionCommand();
        try{
           if (arg.equals("Windows"))
        	   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
           else if(arg.equals("Motif"))
               UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
           else if(arg.equals("Metal"))
        	   UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel" );
           SwingUtilities.updateComponentTreeUI(this);
        }catch(Exception ee){}
       
        if(arg.equals("开始"))
        {
	        sum=0;sum_ying=0;sum_shu=0;
	        try {
	    		finalize();
	    	} catch (Throwable e1) {
	    	    e1.printStackTrace();
	    	}
	        jtext.setText("");
	        jtext2.setText("");
	        jtext3.setText("");
	    }

    	if(arg.equals("清除右边两个框的内容"))
    	{
	       	jtext3.append("共"+sum+"盘,计算机胜率为"+String.format("%.2f",(double)sum_shu/sum)+"\n");
	        sum=0;sum_ying=0;sum_shu=0;
	       	try {
				finalize();
			} catch (Throwable e1) {
				e1.printStackTrace();
			}
	        jtext.setText("");
	        jtext2.setText("");
    	}
        
        if(arg.equals("关于"))
            JOptionPane.showMessageDialog(this, "剪刀石头布程序仅为本人的业余研究,欢迎提供改进意见~~——By qq:996169482", "关于", 0);
        if(arg.equals("退出"))
            System.exit(0);
    }
}

你可能感兴趣的:(石头剪刀布人机对战)