• 大小: 217KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: 其他
  • 标签: 成语接龙  代码  C#  

资源简介

其中实现了汉字内码的使用,汉字拼音排序的实现

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace ChengYuJieLong
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void Submit_Click(object sender EventArgs e)
        {
            SubmitInput();
        }

        private void StartByPC_Click(object sender EventArgs e)
        {
            Results.Clear();
            isUsed = null;
            isUsed = new bool[40000];
            int index;
            do 
            {
                index = rand.Next(1 cyCount);
                if (InCharTable(GetNeedCatchCode(chengyulist[index])))
                {
                    break;
                }
            } while (true);
            
            catchCharIndex = CodeToIndex(GetNeedCatchCode(chengyulist[index]));
            isUsed[index] = true;
            PutOutString(chengyulist[index]);
        }

        private void GiveTip_Click(object sender EventArgs e)
        {
            if (cyCount <= 0)
            {
                return;
            }
            if (inverse.Checked)
            {
                GiveInverseNext();
            }
            else
            {
                GiveNext();
            }
        }

        private void Quit_Click(object sender EventArgs e)
        {
            Close();
        }

        private void GetbaseData()
        {
            byte[] temp = new byte[2000];
            int pyindex = 0;
            FileStream basetable = File.OpenRead(“拼音顺序区位码表.TXT“);
            int i tempint;
            int charIndex lastchar = -1;
            int readsize;
            while (basetable.CanRead)
            {
                readsize = basetable.Read(temp 0 2000);
                if (readsize < 2000)
                {
                    basetable.Close();
                }
                for (i = 0; i < 2000 - 10 && temp[i] > 0; i++ )
                {
                    tempint = 0;
                    do 
                    {
                        tempint *= 10;
                        tempint += temp[i] - 48;
                        i++;
                    } while (temp[i] != 13);
                    i++;

                    if (tempint > 500)  //超过拼音编码的范围,作为汉字编码处理
                    {
                        charIndex = (tempint / 100 - 16) * 94 + tempint % 100 - 1;
                        qwmtable[72 * 94 + charIndex] = pyindex;
                        if (lastchar >= 0)
                        {
                            qwmtable[lastchar] = tempint;
                        }
                        else
                        {
                            pinyintable[pyindex - 1] = tempint;
                        }

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

     文件       5612  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\Properties\Resources.resx

     文件        249  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\Properties\Settings.settings

     文件       1364  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\Properties\AssemblyInfo.cs

     文件       2878  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\Properties\Resources.Designer.cs

     文件       1099  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\Properties\Settings.Designer.cs

     文件      10317  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\Form1.Designer.cs

     文件       3774  2009-02-14 12:07  ChengYuJieLong\ChengYuJieLong\ChengYuJieLong.csproj

     文件        490  2007-07-21 01:33  ChengYuJieLong\ChengYuJieLong\bin\Debug\ChengYuJieLong.vshost.exe.manifest

     文件      14328  2009-02-14 12:03  ChengYuJieLong\ChengYuJieLong\bin\Debug\ChengYuJieLong.vshost.exe

     文件        490  2007-07-21 01:33  ChengYuJieLong\ChengYuJieLong\bin\Release\ChengYuJieLong.vshost.exe.manifest

     文件      14328  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\bin\Release\ChengYuJieLong.vshost.exe

     文件      15360  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\bin\Release\ChengYuJieLong.exe

     文件      34304  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\bin\Release\ChengYuJieLong.pdb

     文件      42485  2009-02-22 15:24  ChengYuJieLong\ChengYuJieLong\bin\Release\拼音顺序区位码表.TXT

     文件     313132  2009-02-21 23:40  ChengYuJieLong\ChengYuJieLong\bin\Release\成语大全.TXT

     文件       7454  2009-03-05 23:25  ChengYuJieLong\ChengYuJieLong\bin\Release\CYJL.ico

     文件        180  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.MainForm.resources

     文件        180  2009-02-14 12:07  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.Properties.Resources.resources

     文件      15360  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.exe

     文件        920  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.csproj.FileListAbsolute.txt

     文件      34304  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.pdb

     文件        847  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\obj\Release\ChengYuJieLong.csproj.GenerateResource.Cache

     文件       5814  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\Form1.resx

     文件      13603  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong\Form1.cs

     文件        498  2009-02-14 12:05  ChengYuJieLong\ChengYuJieLong\Program.cs

     文件        932  2009-02-14 12:03  ChengYuJieLong\ChengYuJieLong.sln

    ..A..H.     19456  2009-03-05 22:47  ChengYuJieLong\ChengYuJieLong.suo

     目录          0  2009-02-14 12:02  ChengYuJieLong\ChengYuJieLong\obj\Debug\TempPE

     目录          0  2009-02-14 12:04  ChengYuJieLong\ChengYuJieLong\obj\Release\TempPE

     目录          0  2009-02-14 12:05  ChengYuJieLong\ChengYuJieLong\obj\Release\Refactor

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

评论

共有 条评论