Open jmolero opened 4 years ago
Hi @jmolero, yes, the idea of using TS is mostly to make sure those little details. I have seen this engine in production in many places, and it performs very well; however, sneaky bugs are always there.
At the moment I'm a little busy at work, but I plan to come back to this in the future.
I think I found a bug on the way the deck is updated in the state when taking an action.
There are 5 filters on game.js that update the deck like this:
deck = deck.filter(x => [cardLeft, cardRight].indexOf(x) === -1)
This removes all occurrences of cardLeft and cardRight and I think they are not needed because the cards are already removed when splicing the deck to get the hand or dealer cards. I think this is a bug when playing with more than one deck.To fix that for this particular filter (the second one in game.js) I updated the deck like this:
const { deck } = this.state
And removed the line with the filter. The rest can be a bit different depending on where the state deck is, but I think all 5 filters need to be removed.I saw on #63 that you are planning on transcribing the project to typescript. Can you check that too while you are at it?