From 7b47977598519aa9ea80e86f80601ad25e3b1464 Mon Sep 17 00:00:00 2001 From: Thayol Date: Mon, 19 Jul 2021 02:25:20 +0200 Subject: [PATCH] Removed unused compression --- script.js | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/script.js b/script.js index 8d311a5..e2de658 100644 --- a/script.js +++ b/script.js @@ -476,6 +476,10 @@ function recommendThrowaway(depth = 0, thisHand = null, thisDeck = null, chance let result = getHandPoints(hands[choice.index]); if (!greedyAlgorithm) { result.points = cashOut(hands[choice.index], result, false); + if (hands[choice.index].length < handSize) { + // create new hands and push all possible permutations + // might need a separate loop + } } if (result.points > 0) { @@ -486,7 +490,7 @@ function recommendThrowaway(depth = 0, thisHand = null, thisDeck = null, chance let thisChance = 1; if (thisDeck.length > 0) { - thisChance = chance * (1/thisDeck.length); + thisChance = chance * (1 / thisDeck.length); } choice.chance = thisChance; @@ -496,29 +500,6 @@ function recommendThrowaway(depth = 0, thisHand = null, thisDeck = null, chance } } - // compress recommendations - if (choices.length > 0) { - // recommendations = [...new Set(recommendations)]; - - // only allow one recommendation per pattern - // let newRecs = []; - // for (let rec of recommendations) { - // if (!newRecs.map(newRec => newRec.pattern).includes(rec.pattern)) { - // newRecs.push(rec); - // } - // } - - // only allow one recommendation per signature - // let newRecs = []; - // for (let rec of recommendations) { - // if (!newRecs.map(newRec => newRec.cardSignature).includes(rec.cardSignature)) { - // newRecs.push(rec); - // } - // } - - // recommendations = newRecs; - } - for (let choice of choices) { if (!choice.points) { choice.points = 0;