land_simulate {axisandallies}R Documentation

Simulate Land Battles

Description

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.

Usage

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
)

Arguments

offense_infantry

Number of infantry on the attacking side, which hit when the dice roll is a 1

offense_artillery

Number of artillery on the attacking side, which hit when the dice roll is a 2 or less

offense_tanks

Number of tanks on the attacking side, which hit when the dice roll is a 3 or less

offense_fighters

Number of fighters on the attacking side, which hit when the dice roll is a 3 or less

offense_bombers

Number of bombers on the attacking side, which hit when the dice roll is a 4 or less

defense_infantry

Number of infantry on the defending side, which hit when the dice roll is a 2 or less

defense_artillery

Number of artillery on the defending side, which hit when the dice roll is a 2 or less

defense_tanks

Number of tanks on the defending side, which hit when the dice roll is a 3 or less

defense_fighters

Number of infantry on the defending side, which hit when the dice roll is a 4 or less

defense_bombers

Number of infantry on the defending side, which hit when the dice roll is a 1 or less

aagun

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

bombarding_battleships

Number of bombarding battleships, which bombard at the start of the battle, and hit at 4 or less

bombarding_cruisers

Number of bombarding cruisers, which bombard at the start of the battle, and hit at 3 or less

sample_size

Number of land battles simulated

decimals

Number of decimal places the percentages are rounded to

write_to_console

If true, writes the output to the console, if false, returns as a vector

Value

Percentage of the land battles won and lost.

Examples

land_simulate(offense_infantry = 10, defense_infantry = 6, decimals = 2)



[Package axisandallies version 0.1.0 Index]