Simulates a number of land battles and gives the percentage of them won and lost. Use to find the probability of winning a particular land battle.
land_simulate(
offense_infantry = 0,
offense_artillery = 0,
offense_tanks = 0,
offense_fighters = 0,
offense_bombers = 0,
defense_infantry = 0,
defense_artillery = 0,
defense_tanks = 0,
defense_fighters = 0,
defense_bombers = 0,
aagun = FALSE,
bombarding_battleships = 0,
bombarding_cruisers = 0,
sample_size = 10000,
decimals = 1,
write_to_console = TRUE
)Percentage of the land battles won and lost.
Number of infantry on the attacking side, which hit when the dice roll is a 1
Number of artillery on the attacking side, which hit when the dice roll is a 2 or less
Number of tanks on the attacking side, which hit when the dice roll is a 3 or less
Number of fighters on the attacking side, which hit when the dice roll is a 3 or less
Number of bombers on the attacking side, which hit when the dice roll is a 4 or less
Number of infantry on the defending side, which hit when the dice roll is a 2 or less
Number of artillery on the defending side, which hit when the dice roll is a 2 or less
Number of tanks on the defending side, which hit when the dice roll is a 3 or less
Number of infantry on the defending side, which hit when the dice roll is a 4 or less
Number of infantry on the defending side, which hit when the dice roll is a 1 or less
Whether or not an Anti-Air gun is present, which rolls one time at the beginning of the battle for each attacking aircraft, and hits if the roll is a 1
Number of bombarding battleships, which bombard at the start of the battle, and hit at 4 or less
Number of bombarding cruisers, which bombard at the start of the battle, and hit at 3 or less
Number of land battles simulated
Number of decimal places the percentages are rounded to
If true, writes the output to the console, if false, returns as a vector
land_simulate(offense_infantry = 10, defense_infantry = 6, decimals = 2)
Run the code above in your browser using DataLab