Optimized defaults

This commit is contained in:
2021-06-24 01:26:57 +02:00
parent 1ef838ff88
commit aa0a23e702
+21 -12
View File
@@ -494,7 +494,8 @@ function recommendThrowaway(depth = 0, thisHand = null, thisDeck = null, chance
thisChance = chance * (1/thisDeck.length); thisChance = chance * (1/thisDeck.length);
} }
choice.chance = thisChance choice.chance = thisChance;
choice.cardSignature = choice.cards.join(" ");
recommendations.push(choice); recommendations.push(choice);
} }
@@ -502,17 +503,25 @@ function recommendThrowaway(depth = 0, thisHand = null, thisDeck = null, chance
// compress recommendations // compress recommendations
if (choices.length > 0) { if (choices.length > 0) {
recommendations = [...new Set(recommendations)]; // recommendations = [...new Set(recommendations)];
// only allow one recommendation per pattern // only allow one recommendation per pattern
let newRecs = []; // let newRecs = [];
for (let rec of recommendations) { // for (let rec of recommendations) {
if (!newRecs.map(newRec => newRec.pattern).includes(rec.pattern)) { // if (!newRecs.map(newRec => newRec.pattern).includes(rec.pattern)) {
newRecs.push(rec); // newRecs.push(rec);
} // }
} // }
recommendations = newRecs; // 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) { for (let choice of choices) {
@@ -569,9 +578,9 @@ function updateUI(skipAuto = false) {
if (hand.length >= handSize) { if (hand.length >= handSize) {
recommend(); recommend();
} }
else { // else {
recommendations = []; // recommendations = [];
} // }
} }
recommendationArray = []; recommendationArray = [];
for (let recommendation of recommendations) { for (let recommendation of recommendations) {