OP is a based madlad for writing a text adventure game -- for ancient retro hardware -- to amuse their kid. If kids are going to be exposed to technology at all, the old 8-bitters are much more effective at stimulating curiosity, imagination, and learning than an iPad with Cocomelon or Skibidi Toilet queued up -- even in emulated form.
I taught him how to divide the range in half to cut down on the number of guesses, and once he got the hang of that he was hooked.
We played a couple of simple text-based games together after that, but most of the classics were too hard, too long, and required too much typing for him. So the game I made was deliberately simple.
Even so the first time he played he had no idea that a rug could cover a trapdoor. That level of hiding things was too much for him to leap to himself, I had to direct him.
These kinda shared activities don't replace his love of Minecraft, or Super Mario Bros (original NES version!), but I'm still glad we can do them together.