If you have really studied the code and don't understand how the program produces the output that you are seeing, here's a suggestion:

Why don't you "play like" you are the computer?

How's how...