Webgameis a new style of game; you do not need the game client. Users can play throughthe browser. GuduSanGuo is a strategy type of webgame, in GuduSanGuo you canbuild your own army to attack other country.<o:p></o:p>
Thereare many kinds of units you can build. Each unit has its own attributes:attack, hit point (hp), armor. When you own a strong army, you can start thewar. Of course before the war, you must detect the military strength you attackagainst. For a coming war, you have to estimate the cost of the war. In thegame the cost of the war is the units you lost which can calculated as follows:the number of lost units = (attacks - armor) / hp. Each war breakout among cities,in a city there are more than one kind of unit. So the damage should distributeto each unit. The damage each unit bear is decided by the number of units inthe proportion of total units count. For example, there are two kinds of unit: Footmanand Archer. The number of Footman is 70 and Archer is 30.If the total damagesis 100,the result is,70% damages to Footman and 30% damages to Archer.<o:p></o:p>
Science and technology played an important role, you can upgrade yourarmy’s defense and attack, and you can assume that each level upgrade 10% ofthe unit’s initial armor and attack.<o:p></o:p>
Alsoyou can attack one city with many cities simultaneously, but the war iscalculated separately and the order of the war is decision by arrive time. Nowcan you program and calculate the results of the war? You should note that allcalculations are based on integer, the decimal is ignored.<o:p></o:p>