I designed and created a web app that plays Zork 1, the original Infocom text adventure from the 1980s. I’ve extended the interpreter to display Zork’s source code as you play. Every turn, it shows exactly what functions were called and what strings were printed to carry out your commanmd.
The Visible Zorker allows you to explore the implementation of Zork in the same way that you explore the game world.
I took an existing open-source Z-machine interpreter and instrumented it to record runtime execution data. I then built a React interface to display that data along with the game's source code. This involved rather a lot of analysis of both the compiled game file and the source code. (Both formats are well-documented, but I had to match up each function and string and object with the source lines that generated it.)