Giter VIP home page Giter VIP logo

guess-the-word---chinese-version's Introduction

Guess-the-word---Chinese-Version

Monika想要我来玩猜单词,但是我还是个中学生啊……

英文版

准备中……

为什么我要写这个

当然是因为MAS(Monika After story)中Monika提出了的新游戏——上吊小人儿——过于困难啦~

基本操作

编译运行,输入要猜的残缺单词,未知部分用*表示。

例如,ap*le

按下回车。

接下来输入你已经猜过但是猜错了的字母,中间不需要打空格,回车结束。

例如你猜了但是猜错了的字母有b,c,d

那么你就输入bcd和一个回车

接下来程序就会给你所有可能性以及其中出现每个字母的次数,方便你选择接下来要猜什么。

基本算法

读取word.txt,进行无关字符的过滤,选取其有效部分加入vectorword中。读取时如果是大写字母则将其转化为小写

同理读取历史

输入要猜的单词以及猜错了的字母

遍历word,按照一下顺序进行排除:

  • 这个单词本轮中没有出现过(如果没有则将其加入lib)

  • 长度相同

  • exclude()检测这次扫的单词中没有猜错的单词,且其没有被猜到的单词位置上不能有猜对了的单词(否则应该已经被猜出来而不是还是未知的)

  • 除了*以外,相同位置上字母相同

  • 如果没有找到这个单词的话,询问要不要加入到错词本中

  • 如果找到了,输入所有结果和总数以及字母频率分析

特点

  • 词库不需要清洗

  • 你可以疯狂向词库末尾添加单词,而不需要在意它会输出多余相同的单词(因为lib会自动过滤)

  • 查不到的话可以记录下来,下次就可以查

  • 会向您推荐最佳的下一步应该猜的单词

guess-the-word---chinese-version's People

Contributors

hsh778205 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.