基本信息
源码名称:字谜填词游戏
源码大小:4.38M
文件格式:.7z
开发语言:C/C++
更新时间:2021-07-28
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍


采用哈希算法实现字谜游戏(PuzzleGame),在白色区域的没有填写字母的位置填写合适的字母,是连在一起的白色区域(行或列)中字母构成一个有意义的单词。


用哈希算法实现几十万单词查询,完成字谜游戏



        提示输入选择读入的主词库


    符合要求的答案


存储结构定义如下:

struct words_only
{
    char word[45]{};  // 我也不想,但是最长的单词就是45个字母
   
int hash_num = 0;   // 查找次数
   
int means_pos = 0;  // 释义位置
};

struct words_translation
{
    char means[300]; // 解释的长度超乎你的想象
};

struct ir_nouns_only
{
    int word_pos = 0;
    int ir_word_pos = 0;
};

struct ir_verbs_only
{
    int trans_pos = 0;
    int word_pos = 0;
};

struct word_blank
{
    int row{};
    int col{};
    bool isSolve{};
    bool ans[26]{};   // 只支持小写字母
};

函数定义如下:

bool read_file_all();

void readgraph();

inline int hash(char s[] , int & hash_num , int mod);

inline int decrypt(char s[] , int mod , int hash_num = 0);

inline void generate_word(std::vector<int>blank_num_in_line , char word[] , bool can[]);