To track the money over the course of an Axis and Allies game in MATLAB, you can create a script that prompts the user for the starting amount and then allows them to input the amount earned/lost at the end of each turn. The script can then keep track of the total amount of money and plot it as a function of the number of turns.
Here's an example code:
main.m836 chars33 lines
This code prompts the user for the starting amount of money, then enters a loop where it prompts the user for the amount earned or lost during each turn. It keeps track of the total amount of money and records a history of the money at the end of each turn. The plot function is called to plot the money history as a function of the number of turns. The user is then prompted whether they want to continue or not, and the loop continues until the user enters 'n'.
With this script, you can then track the money over the course of an Axis and Allies game and analyze the data to see how well different strategies perform financially.
gistlibby LogSnag