How does the web app http://20q.net work? Can I write a similar program, in a smaller scale, and if yes how?
Tell me more
×
Programmers Stack Exchange is a question and answer site for
professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
|
Sure, this is called an "expert system" and can be represented by a binary tree (in the case of yes/no questions only). Each non-leaf node in your tree is a question (e.g. Is it a mammal?). Each leaf is a final answer (e.g. Giraffe) with an implied question Is it a giraffe?. If the answer to this final question is yes, the user guessed the answer. If the answer is no, then the user should be prompted to input a new question (added to the database) where the answer is yes for the new answer (e.g. wombat) and no for the old answer (giraffe). The system grows in "intelligence" the more it is used. |
|||||
|