Closed markbrouch closed 7 years ago
@markbrouch default value of bet
was arbitrarily sets to 10
since the beginning.
Last commit provides better defaults but in real situations, when you are actually using the engine, passing values from the client, it should not be an issue.
This is off course a lack of documentation in this project...
@kedoska awesome thanks for the quick fix! I'm using the engine in a little blackjack training app that doesn't actually play a whole game so the betting doesn't matter much to me. I just passed an arbitrary value so it wouldn't error. https://github.com/markbrouch/alexa-blackjack-trainer
What kind of issue is this? "Bug" or "New Feature"
Bug
Actual behavior
Unexpected exception 'TypeError: Cannot read property 'bet' of undefined'
How can we reproduce it? From "Stage" -> "Action" -> Cards
Error goes away by providing a bet value of 0 to
deal({ bet: 0 })
, but I think ifbet
is omitted it should automatically default 0 instead of throwing error.