People of a certain age (and geographic location) will remember the Usborne Write Your Own Adventure Programs[0] book that taught kids the intricacies of string parsing and data driven programming in basic. I used that book to write several adventures of increasing complexity during my early teens.
[0] https://sheep.horse/2017/2/usborne_computer_books.html (self link)