资源简介
自制的C语言打单词游戏程序的源代码和模块划分,提供大家贡献使用
代码片段和文件信息
#include“data_source.h“
#define MAX_WORDS 256
struct dictionary
{
char *words[MAX_WORDS];
char *file_name;
int num;
}g_dictionary;//结构体变量为全局变量,为了私有不让其他模块看见
//由于结构体变量为全局变量,所以所有元素为0值
int is_same_word(const char *word)
{
int j = 0;
for (; j {
if (!stricmp(g_dictionary.words[j] word))//出现相同,则放弃这个单词
{
return -1;
}
}
return j;
}
void add(const char *word)
{
int n = is_same_word(word);
if (n!=-1)
{
g_dictionary.words[n] = _strdup(word);
g_dictionary.num++;
}
}
struct dictionary *download(const char *file_name)//下载数据源,并分割单词
{ release();
parse(file_nameadd);
//char *words;
//FILE *fp = fopen(file_name “r“);//文件读取
//if (NULL != fp)
//{
// char buffer2[500];
// while (!feof(fp))//判断文件是否读到末尾,如果未读到末
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 309 2019-06-01 19:54 hit_words1\data_source.h
文件 2646 2019-06-01 21:35 hit_words1\data_sources.c
文件 26463 2019-06-12 18:28 hit_words1\Debug\data_sources.obj
文件 17443 2019-06-12 18:28 hit_words1\Debug\displays.obj
文件 1583 2019-06-12 18:28 hit_words1\Debug\hit_words1.Build.CppClean.log
文件 3146 2019-06-12 18:28 hit_words1\Debug\hit_words1.log
文件 3826 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\cl.command.1.tlog
文件 75784 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\CL.read.1.tlog
文件 3932 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\CL.write.1.tlog
文件 195 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\hit_words1.lastbuildstate
文件 2298 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\li
文件 4232 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\li
文件 1442 2019-06-12 18:28 hit_words1\Debug\hit_words1.tlog\li
文件 27923 2019-06-12 18:28 hit_words1\Debug\Launchers.obj
文件 26699 2019-06-12 18:28 hit_words1\Debug\main.obj
文件 388096 2019-06-12 18:28 hit_words1\Debug\vc120.idb
文件 94208 2019-06-12 18:28 hit_words1\Debug\vc120.pdb
文件 24655 2019-06-12 18:28 hit_words1\Debug\word_division.obj
文件 373 2019-06-01 16:26 hit_words1\display.h
文件 3568 2019-06-01 15:19 hit_words1\displays.c
文件 325 2019-06-01 21:23 hit_words1\file_division.h
文件 13312 2019-04-19 18:59 hit_words1\glConsole.dll
文件 1664 2019-04-19 18:52 hit_words1\glConsole.h
文件 5920 2019-04-19 18:59 hit_words1\glConsole.lib
文件 4428 2019-05-30 20:51 hit_words1\hit_words1.vcxproj
文件 1802 2019-05-30 20:51 hit_words1\hit_words1.vcxproj.filters
文件 350 2019-06-01 16:26 hit_words1\Launcher.h
文件 1858 2019-06-01 16:45 hit_words1\Launchers.c
文件 1665 2019-06-01 15:11 hit_words1\main.c
文件 1145 2019-06-01 21:23 hit_words1\word_division.c
............此处省略8个文件信息
- 上一篇:canny边缘检测自适应
- 下一篇:机器学习贝叶斯学习器——关于是否打网球的源代码
评论
共有 条评论