Fix blackjack ace calculation breaking if ace isn't last card

This commit is contained in:
Daniel Odendahl Jr
2018-09-18 22:39:08 +00:00
parent 557619961a
commit 60238cbc43
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ module.exports = class BlackjackCommand extends Command {
}
calculate(hand) {
return hand.reduce((a, b) => {
return hand.sort((a, b) => a.value - b.value).reduce((a, b) => {
let { value } = b;
if (value === 11 && a + value > 21) value = 1;
return a + value;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "91.5.2",
"version": "91.5.3",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {