Back in the late 80s, I learned much about computer programming from this book: Write Your Own Adventure Programs For Your Microcomputer. This is the same book that I used as a guide when creating Malfunction for my Apple IIgs back in 1988.
The book takes you step-by-step through the process of creating a simple text adventure game using Applesoft Basic. The final product is an adventure called "Haunted House." It's about as crude and bare bones as a work of interactive fiction can be, but it does what it needs to: there are objects, rooms and key puzzles.