← AI
🦁
Guess the Animal (20 Questions AI)
A rule-based 'mind reader' that guesses your animal in under 7 yes/no questions.
🟢 EasyDifficulty
2-3 hoursTime
Python, JavaScript, TypeScriptLanguages
What you're building
You're building the classic 20-questions party trick, except it lives in a browser tab and never gets bored of playing. Under the hood there's no real intelligence at all -- just a tree of yes/no questions that narrows down the answer branch by branch, like a game of hot-and-cold. It feels eerily smart to a player even though it's really just nested if-statements in a trench coat.
What you'll unlock 🔓
You'll need
- Basic JavaScript
- A code editor
- A browser
🗺️ Build roadmap
01 Sketch your decision tree on paper
→
02 Build the question screen UI
→
03 Encode the tree as JavaScript objects
→
04 Wire up Yes/No buttons to walk the tree
→
05 Show the final guess screen
→
06 Add a 'was I right?' feedback loop
→
07 Polish with animations and a play-again button
🔒
Log in to start building
Your first project is free -- create an account to unlock it.
Log in Sign up free