• 大小: 0.15M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-03-27
  • 语言: C#
  • 标签: c#  

资源简介


自己用C#实现的八数码问题,有图形界面,采用广度优先算法和启发式搜索

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EightNum
{
    class EnAlgorithm
    {
        Form1 form1;

        //------------------------------------------------------------------
        public EnAlgorithm(Form1 a)
        {
            this.form1 = a;
        }

        //启发式搜索算法
        public void getFinPathQf()//寻找解路径,创建关键路径数组
        {
            this.initSerchQf();//搜索初始化

            int deep = 1;
            while (form1.finc == -1)
            {
                this.goNextDeepQf(deep);
                deep++;
            }

            if (form1.finc == 0)//本身就是目标状态且没有溢出
            {
                form1.fin[0] = new KeyArr(form1.templeQf[0].key);
                //fin[0].k = temple[0].key;
            }

            if (!form1.isOverFlow)
            {
                try
                {
                    int tag = form1.finc;
                    for (int j = 1; tag != 0; j+

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

     文件      36864  2012-12-23 11:12  EightNum\EightNum\bin\Debug\EightNum.exe

     文件      85504  2012-12-23 11:12  EightNum\EightNum\bin\Debug\EightNum.pdb

     文件      11600  2013-01-01 21:45  EightNum\EightNum\bin\Debug\EightNum.vshost.exe

     文件        490  2010-03-17 22:39  EightNum\EightNum\bin\Debug\EightNum.vshost.exe.manifest

     文件      32768  2012-11-09 15:10  EightNum\EightNum\bin\Release\EightNum.exe

     文件      58880  2012-11-09 15:10  EightNum\EightNum\bin\Release\EightNum.pdb

     文件      11600  2012-11-09 15:10  EightNum\EightNum\bin\Release\EightNum.vshost.exe

     文件        490  2010-03-17 22:39  EightNum\EightNum\bin\Release\EightNum.vshost.exe.manifest

     文件       4171  2012-11-28 21:55  EightNum\EightNum\EightNum.csproj

     文件      12908  2012-11-29 20:25  EightNum\EightNum\EnAlgorithm.cs

     文件       2497  2012-11-16 20:25  EightNum\EightNum\Enode.cs

     文件      21074  2012-11-30 11:12  EightNum\EightNum\Form1.cs

     文件      35784  2012-11-29 20:18  EightNum\EightNum\Form1.Designer.cs

     文件       6411  2012-11-29 20:18  EightNum\EightNum\Form1.resx

     文件       2027  2012-11-09 16:13  EightNum\EightNum\Form2.cs

     文件       9365  2012-11-07 20:08  EightNum\EightNum\Form2.Designer.cs

     文件       5817  2012-11-07 20:08  EightNum\EightNum\Form2.resx

     文件        268  2012-11-07 21:44  EightNum\EightNum\KeyArr.cs

     文件       4440  2012-11-07 14:29  EightNum\EightNum\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6313  2013-01-01 21:44  EightNum\EightNum\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1024  2013-01-01 21:45  EightNum\EightNum\obj\x86\Debug\EightNum.csproj.FileListAbsolute.txt

     文件      36864  2012-12-23 11:12  EightNum\EightNum\obj\x86\Debug\EightNum.exe

     文件        180  2012-11-29 20:18  EightNum\EightNum\obj\x86\Debug\EightNum.Form1.resources

     文件        180  2012-11-28 21:55  EightNum\EightNum\obj\x86\Debug\EightNum.Form2.resources

     文件      85504  2012-12-23 11:12  EightNum\EightNum\obj\x86\Debug\EightNum.pdb

     文件        180  2012-11-28 21:55  EightNum\EightNum\obj\x86\Debug\EightNum.Properties.Resources.resources

     文件        380  2012-11-29 20:18  EightNum\EightNum\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1540  2012-11-29 20:18  EightNum\EightNum\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       7897  2012-11-07 14:37  EightNum\EightNum\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       6236  2012-11-09 15:10  EightNum\EightNum\obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache

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

评论

共有 条评论