Question
How to create two functions that the player may use to implement their strategy. Create a ___function___ called `lookup_action` with two ___arguments___ `hand` and `dealer_card`.
How to create two functions that the player may use to implement their strategy. Create a ___function___ called `lookup_action` with two ___arguments___ `hand` and `dealer_card`. The ___function___ `lookup_action` should ___return___ whether the player should "Hit" or "Stand" using the ___data frame___ `df_action_lookup`. Create another ___function___ called `lookup_action_alt` with the same arguments as `lookup_action`. The ___function___ `lookup_action_alt` should ___return___ whether the player should "Hit" or "Stand" using the ___data frame___ `df_action_lookup_alt`.
Additional information: We can implement a lookup table in R using a ___data frame___. The ___data frame___ will be used to determine if the player should perform the action `hit` or `stand` based on: 1. _hand_value_: The sum of the cards in the player hand i.e. column hand_value 2. _useable_ace_: Whether the hand of the player contains a useable ace, an ace than can count as 11 without the player going `bust` (column: usable_ace) 3. _dealer_ace_ to _dealer_ten_: the face-up card of the dealer Two lookup tables have been created, `df_action_lookup` and `df_action_lookup_alt`. `df_action_lookup` is the player's default strategy, while `df_action_lookup_alt` serves as the alternative strategy.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started