In 1986 Time Life books put out their “Understanding Computers” series of 24 books which cover the basics of computing - the series is a snaphot of the technology at the time just before the internet changed everything.
From the volume on Artifical Intelligence here is a story of a robot who learns to distinguish between greedy and generous dragons in order to get the gold to fill the pot at the end of the rainbow.
From this volume, here’s 4 more pages used as chapter intros: