资源简介

文件中包含全部A*算法的代码,可执行jar文件,并有游戏可以玩,来辅助理解野人和传教士问题,以及验证程序提供的方案。 程序不仅可以计算 有3对野人传教士和载荷为2的船的运载方案,还可扩展到最多15对野人和传教士,以及15载荷的船的运载方案。 代码使用java编写,游戏使用c#编写。 --------广东外语外贸大学

资源截图

代码片段和文件信息

/*
 * To change this license header choose License Headers in Project Properties.
 * To change this template file choose Tools | Templates
 * and open the template in the editor.
 */
package wild_man_and_chuanjiaoshi;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Jframe;
import javax.swing.JOptionPane;
import wild_man_and_chuanjiaoshi.picture.anquan;

/**
 *
 * @author 郭昊然
 */
public class game_show extends javax.swing.Jframe {
    jisuan ji;//使用计算方法
    
    /**
     * Creates new form game_show
     */
    public game_show() {
        initComponents();
        
         setDefaultCloseOperation(Jframe.DO_NOTHING_ON_CLOSE);//设置窗口关闭不可以
        this.addWindowListener(new WindowAdapter(){//添加退出监听
        public void windowClosing(WindowEvent e)
        {
            dispose();//关闭9按键为关闭本窗口
            anquan.chushihua();
            if(anquan.isok())//chao_le
            {
                anquan.showinfo();
            // new banquan().setVisible(true);    
            }else
            {
                anquan.tui();
            }
            
      }});
        ji=new jisuan(Integer.parseInt(peoplenum.getText())Integer.parseInt(shipnum.getText()));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings(“unchecked“)
    // //GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        peoplenum = new javax.swing.JLabel();
        shipnum = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        yidongfangfa = new javax.swing.JTextArea();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font(“微软雅黑“ 1 18)); // NOI18N
        jLabel1.setText(“野人数量(N)/
\n传教士数量(N)\n“);

        jLabel2.setFont(new java.awt.Font(“微软雅黑“ 1 18)); // NOI18N
        jLabel2.setText(“船最大载客(K)“);

        peoplenum.setFont(new java.awt.Font(“楷体“ 1 36)); // NOI18N
        peoplenum.setText(“3“);

        shipnum.setFont(new java.awt.Font(“楷体“ 1 36)); // NOI18N
        shipnum.setText(“2“);
        sh

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

     文件        127  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\built-jar.properties

     文件        916  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$1.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$2.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$3.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$4.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$5.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$6.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$7.class

     文件        854  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$8.class

     文件        584  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show$9.class

     文件      12743  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\game_show.class

     文件        704  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\guize$1.class

     文件        826  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\guize$2.class

     文件        568  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\guize$3.class

     文件       7079  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\guize.class

     文件       5302  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\jisuan.class

     文件       1544  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\picture\anquan.class

     文件       4776  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\picture\shang.png

     文件       4813  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\picture\xia.png

     文件        722  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\playgame$1.class

     文件        580  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\playgame$2.class

     文件       3290  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\playgame.class

     文件        561  2016-12-06 09:41  wild_man_and_chuanjiaoshi\build\classes\wild_man_and_chuanjiaoshi\Wild_man_and_chuanjiaoshi.class

     文件       3660  2016-12-04 09:53  wild_man_and_chuanjiaoshi\build.xml

     文件       1341  2016-12-06 09:41  wild_man_and_chuanjiaoshi\dist\README.TXT

     文件      55274  2016-12-06 09:41  wild_man_and_chuanjiaoshi\dist\wild_man_and_chuanjiaoshi.jar

     文件   17729536  2016-09-01 18:32  wild_man_and_chuanjiaoshi\dist\野人与传教士.exe

     文件         33  2016-12-05 22:58  wild_man_and_chuanjiaoshi\dist\野人与传教士_Data\app.info

     文件      21684  2016-12-05 22:58  wild_man_and_chuanjiaoshi\dist\野人与传教士_Data\globalgamemanagers

     文件      11652  2016-12-05 22:58  wild_man_and_chuanjiaoshi\dist\野人与传教士_Data\globalgamemanagers.assets

............此处省略78个文件信息

评论

共有 条评论