Skip to content

Commit

Permalink
normalize scores
Browse files Browse the repository at this point in the history
  • Loading branch information
EFHIII committed Mar 14, 2024
1 parent 71ed2f3 commit eadf291
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ function run(jokers = [[]]) {

const highestScore = thisHand.simulateBestHand();
const lowestScore = thisHand.simulateWorstHand();
const highestScoreScore = normalizeBig(highestScore);
highestScore[0] = highestScoreScore[0];
highestScore[1] = highestScoreScore[1];
const lowestScoreScore = normalizeBig(lowestScore);
lowestScore[0] = lowestScoreScore[0];
lowestScore[1] = lowestScoreScore[1];

let medianScore = highestScore;
let meanScore = highestScore;
Expand All @@ -261,7 +267,7 @@ function run(jokers = [[]]) {
medianScore = runScores[5000];
}

postMessage([taskID, bestScore, bestJokers, bestCards, bestCardsInHand, highestScore, lowestScore, thisHand.typeOfHand, meanScore, medianScore]);
postMessage([taskID, bestScore, bestJokers, bestCards, bestCardsInHand, highestScore, lowestScore, thisHand.typeOfHand, normalizeBig(meanScore), normalizeBig(medianScore)]);
}

self.onmessage = async function(msg) {
Expand Down

0 comments on commit eadf291

Please sign in to comment.