lucas98774 / rl-blackjack

Implementing rl on blackjack
0 stars 0 forks source link

bug-6 -- Accomodate for 1 or 11 value for aces in hand total #7

Closed Ndiedrick21 closed 2 years ago

lucas98774 commented 2 years ago

Do you think the solution for determining whether an ace should be a 1 or 11 should be determined at the Card level or in the Hand Class? I think it does make the most sense to implement this functionality at the hand level since a player should be able to choose whether the ace needs to be either value. Anyone else have any other thoughts?

Ndiedrick21 commented 2 years ago

I think it makes more sense to put it at the hand level, because the value of an ace only changes in the context of a hand. The PR I made assumes that it will be an 11 unless the player would bust. In an RL context, this may be tricky either way, since the policy doesn't know if the player has an ace just based on the hand value.

Ndiedrick21 commented 2 years ago

I think this code would provide that 1 or 11 functionality, but I think there could be an overall better solution out there.

lucas98774 commented 2 years ago

I think we are doing two separate things here:

  1. Keep track of usable aces
  2. Decrementing the Hand's total based on the usable aces

I think both are in the Hand Class but I think the first should be addressed separately which will make the second cleaner

lucas98774 commented 2 years ago

Check out the update for this. I think the workaround is a bit more intuitive. There shouldn't ever be a reason to change an ace's value back from 1 to 11 again correct? Closing this issue for now since the functionality is provided ... We can keep this in mind and discuss this as an area for improvement but open a new issue if we want to redesign this since that is a separate task.