Alright, let me tell you about this little thing I was tinkering with, something I called ‘Lions Bulls’ in my notes.

It started pretty simply. I was looking for a small coding exercise, you know, just to keep the gears turning. I had this vague idea for a number guessing game. My thinking was, ‘lions’ would be the correct digits in the right spot, and ‘bulls’ maybe… something else? Honestly, looking back, I think I might have gotten it mixed up with that classic ‘Bulls and Cows’ game right from the start. But hey, at the time, ‘Lions Bulls’ sounded kinda cool, more powerful.
Getting Started
So, I fired up my code editor. Decided to use Python because, well, it’s usually straightforward for quick scripts like this. The plan was simple:
- Generate a secret random number (say, 4 digits).
- Let the player guess.
- Compare the guess with the secret number.
- Give feedback using ‘lions’ and ‘bulls’.
Seemed easy enough, right? Famous last words.
The Actual Process
First, I wrote the code to generate the secret number. No sweat. Then I added the input part for the player’s guess. Still cruising. The tricky part came when I tried to implement the logic for counting the ‘lions’ and ‘bulls’.
My first attempt was messy. I had loops inside loops, trying to check each digit of the guess against each digit of the secret number. I kept getting the counts wrong. Sometimes it would say 2 lions when there was only 1. Other times, the bull count was off. I spent, no joke, probably two hours debugging this tiny piece of logic. It felt ridiculous.

It reminded me of this one time I was trying to assemble a simple flat-pack shelf. The instructions looked crystal clear, maybe six steps total. But I somehow put the backing board on backwards, didn’t realize it until the very end, and had to take the whole darn thing apart again. It’s always the ‘simple’ stuff that trips you up because you don’t give it enough respect, I guess.
Back to the code, I eventually figured out a cleaner way. Had to make sure I wasn’t counting the same digit twice – once as a ‘lion’ and then again as a ‘bull’. Needed separate checks. First, find all the exact matches (‘lions’). Then, look for digits that are present but in the wrong spot (‘bulls’), making sure to ignore the digits already marked as ‘lions’.
Where It Ended Up
After wrestling with it, I finally got a version working. You type in your guess, and it spits back something like “2 lions, 1 bull”. And yeah, by this point, I fully realized I’d basically just recreated ‘Bulls and Cows’. Maybe the ‘Lions Bulls’ name was just wishful thinking or a brain fart.
So, there wasn’t some grand project reveal. It’s just a simple command-line game sitting in a folder on my computer. But, you know, going through the process, hitting that snag with the logic, and working it out – that was the real point. It’s good practice. Even if I did end up reinventing the wheel and possibly misnaming it!