Skip to content

Latest commit

 

History

History
77 lines (47 loc) · 1.81 KB

File metadata and controls

77 lines (47 loc) · 1.81 KB

🎯 Bulls and Cows (Rust + egui)

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. 😏


📸 Screenshots

  • Game board: Game screenshot

  • Bot duel: Bot vs Bot

  • Human against BOt: Human vs Bot

  • Bot assist: Bot assist


🕹️ How to play

  • 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.


🤖 How the bot works

The bot isn’t super fancy.

  • It generates all 10P4 possibilities.
  • 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. 🏆


🚀 Running

cargo run --release

Requires Rust 1.86+ (probably works with earlier).


🔮 Roadmap / Ideas

  • 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 😅)

🤝 Contribute

Open PRs, file issues, or just fork and hack. Half the fun is seeing how you would make the bot smarter.


📝 License

MIT — have fun with it.