Actually, I wrote the static game code first, after I finished that, I thought to myself that I can solve the problems from economics textbook with codes. This one is actually quite simple, you use math to find a general solution, then use the program to do the calculation for you, feed the information to get the answer. For example: D: Q=a-bp S: Q=c+dp D=S: a-bp=c+dp p=(a-c)/(b+d) I write the analyses of equilibrium of demand and supply, and specific tax, that's it. If there is any question you want me to solve with code, let me know in the comment below.