determine_winner: Determine winner

Description Usage Arguments Details Value Examples

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

Description

This function determine if the player wins or lose.

Usage

1
determine_winner(final.pick, game)

Arguments

final.pick

Numeric, Player's final pick door between 1&3

game

Character, Car or a Goat

Details

After the player decided his final selection, whether he wants to stay on his first selection or choose to change, this function determine if he win a car or lose it.

Value

Return Character, "WIN" or "Lose"

Examples

1
2
3
final.pick = 1
game <- create_game()
determine_winner <- function( final.pick, game )

Rami-Assaad/montyhall documentation built on Dec. 18, 2021, 9:52 a.m.