determine_winner: Determine If Contestant Has Won

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem.R

Description

If statements are used to compare results of previous step to determine if the contestant has won or lost the game.

Usage

1
determine_winner(final.pick, game)

Arguments

The

determine_winner function calls upon the final.pick and game arguments. The IF statements evaluate the game function based upon final.pick function.

Details

The final.pick is called from a previous step and put through if statements to return the game results. If the final pick was a goat, the result is LOSE. If the contestant picks a car, then the result is a WIN.

Value

The return is an atomic vector

Examples

1
  WIN  LOSE

scribenaz/montyhall documentation built on Jan. 31, 2021, 12:48 a.m.