Way back in the '90s, I read a choose-your-own-adventure style book, where most sections ended in a choice of 2 or 3 different pages to turn to (as is typical).
However, this particular book was different from the others in this category, as some of the sections ended with a code listing in BASIC, and it required the reader to type out and execute the code listing in QBASIC, and based on the execution output, the reader would know which page to turn to.
This was very long ago, so I do not remember very much about the book, not even the actual story, but the one specific thing that I do remember, is that one of the code listings involved "encrypted messages", which you had to "decrypt", and that this was simply by swapping odd and even ASCII character codes.
The closest thing I could find was this, except the book I am after is one with multiple BASIC listings embedded in the sections, and not just a single one at the end.
This book happened to be my first brush to "programming", and the CYOA-style was (retrospectively) what got me motivated to get past the initial hurdle/struggle. I'm hoping to crowd-source the identification not only for nostalgia, but also to mine it for potential education ideas.