A strange thing about the battles seems to be that the outcome depends on casualties and the number of casualties depends on how many men you send into the battle. The more men you send in, the more likely you are to get a higher number of casualties and the higher the chance it is that you lose. Wouldn't the winning strategy be to send in 1 unit of each type, so that your casualties will always be less or equal than the computers?

Other than that, why couldn't you post or attach all the relevant code?