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.



