Simulates one land battle for given attacking and defending units
land_battle(
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,
write_to_console = TRUE
)Offense Loses or Defense Loses and remaining units in lines of text
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
If true, writes the output to the console, if false, returns as a vector
land_battle(offense_tanks = 4, offense_fighters = 3, defense_tanks = 9, aagun = TRUE)
Run the code above in your browser using DataLab