資源簡介
自制的C語言打單詞游戲程序的源代碼和模塊劃分,提供大家貢獻使用
代碼片段和文件信息
#include“data_source.h“
#define?MAX_WORDS?256
struct?dictionary
{
char?*words[MAX_WORDS];
char?*file_name;
int?num;
}g_dictionary;//結(jié)構(gòu)體變量為全局變量,為了私有不讓其他模塊看見
//由于結(jié)構(gòu)體變量為全局變量,所以所有元素為0值
int?is_same_word(const?char?*word)
{
int?j?=?0;
for?(;?j? {
if?(!stricmp(g_dictionary.words[j]?word))//出現(xiàn)相同,則放棄這個單詞
{
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)//下載數(shù)據(jù)源,并分割單詞
{ 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個文件信息
評論
共有 條評論