Simulates one round of sea combat
sea_round(
offense_submarines = 0,
offense_destroyers = 0,
offense_carriers = 0,
offense_cruisers = 0,
offense_battleships = 0,
offense_fighters = 0,
offense_bombers = 0,
defense_submarines = 0,
defense_destroyers = 0,
defense_carriers = 0,
defense_cruisers = 0,
defense_battleships = 0,
defense_fighters = 0,
write_to_console = TRUE
)Number of offensive air hits, offensive submarine hits, offensive other hits, defensive air hits, defensive submarine hits, and defensive other hits in several lines of text
Number of submarines on the attacking side, which hit when the dice roll is a 2 or less
Number of destroyers on the attacking side, which hit when the dice roll is a 2 or less
Number of carriers on the attacking side, which hit when the dice roll is a 1
Number of cruisers on the attacking side, which hit when the dice roll is a 3 or less
Number of battleships on the attacking side, which hit when the dice roll is a 4 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 submarines on the defending side, which hit when the dice roll is a 1
Number of destroyers on the defending side, which hit when the dice roll is a 2 or less
Number of carriers on the defending side, which hit when the dice roll is a 2 or less
Number of cruisers on the defending side, which hit when the dice roll is a 3 or less
Number of battleships on the defending side, which hit when the dice roll is a 4 or less
Number of fighters on the defending side, which hit when the dice roll is a 4 or less
If true, writes the output to the console, if false, returns as a vector
sea_round(offense_submarines = 1, offense_bombers = 1, defense_battleships = 1)
Run the code above in your browser using DataLab