determine_winner: Determine if contestant has won - Function

Description Usage Arguments Details Value Examples

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

Description

This function will help to determine if the contestant has chosen the "car" door, or if the contestant did not. A message will be displayed the "WIn" or "LOSE" words.

Usage

1
determine_winner(final.pick, game)

Arguments

The

function "if" will help to run the code depending on the choice of the contestant. If the contestant chose the door with a car. then the "if" function will print in the screen "WIN" if the contestant choice was a door with a goat, the "if" function will run the code printing the "LOSE" message.

Details

The function will be utilizing the variables "final.pick" and "game" previously used in another function.

Value

Depending on the final pick of the contestant, the word "WIN" or "LOSE" will be displayed.

Examples

1

sandralili/montyhall documentation built on Dec. 22, 2021, 10:14 p.m.