A weekend project that turned into a proper little game. Classic Bulls and Cows (a.k.a. Mastermind with digits)… but with a bot that can play against you — or help you cheat against the bot. 😏
-
Secret password = 4 unique digits.
-
Each guess gets scored:
- 🎯 = correct digit & correct place
- 🎪 = correct digit, wrong place
-
First to crack the code wins!
You can play vs the bot, or let the bot “assist mode” you while you claim the glory.
The bot isn’t super fancy.
- It generates all
10P4possibilities. - After each guess, it filters the list based on feedback.
- Then it just picks the first valid candidate.
That’s it. No deep math, no magic. Just pure Rusty persistence.
Still — it usually wins in ~7 guesses. 🏆
cargo run --releaseRequires Rust 1.86+ (probably works with earlier).
- Smarter strategies (Knuth’s 5-guess, anyone?)
- Prettier UI (animations, scoreboard, etc)
- Fix CPU hogging (egui re-renders every frame — I’ll get to it 😅)
Open PRs, file issues, or just fork and hack. Half the fun is seeing how you would make the bot smarter.
MIT — have fun with it.



