Welcome to Bulls & Cows, a fun and strategic number guessing game! Test your logic skills against an AI opponent and compete in real-time gameplay.
Try the deployed app here: Live Demo — bulls-cows.streamlit.app
Bulls & Cows is a classic code-breaking game where:
- Someone picks a secret 4-digit number
- The other person makes guesses to figure it out
- After each guess, you get feedback:
- 🎯 Bulls = Correct digit in the correct position
- 🐄 Cows = Correct digit in the wrong position
- Classic Mode: You guess the AI's secret number
- Smart Suggestions: Get hints for your next guess
- Entropy Visualization: See how much information you gain with each guess
You'll need:
- Python 3.11 or higher
- Poetry (package manager)
On Mac/Linux:
python3 -m venv .venv && source .venv/bin/activateOn Windows:
python -m venv .venv
.venv\Scripts\Activate.ps1First, install Poetry:
pip install poetryThen install project dependencies:
poetry installWant to play against AI? Here's how:
- Go to Google AI Studio
- Create a free API key
- Create a
.envfile in the project root:GEMINI_API_KEY=your_api_key_here
poetry run appThat's it! Open the game in your browser and start playing! 🎉
- AI picks a secret 4-digit number (0-9, no repeating digits)
- You try to guess it
- After each guess, see Bulls & Cows feedback
- Use logic and our smart suggestions to solve it faster!
- AI and you both guess the same secret number
- First one to crack it wins the round
- Watch the AI's strategy in action
- See how your intuition compares to information theory!
This project is licensed under MIT. See LICENSE for details.
