We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c6a07f commit 98d531eCopy full SHA for 98d531e
index.js
@@ -51,8 +51,8 @@ generateRandomCardButton.addEventListener("click", () => {
51
? 0.025
52
: 0; //add card weight to weight sum
53
if (
54
- number <= totalWeight ||
55
- (number <= weightSum && cards.length > 0)
+ (number <= totalWeight || number <= weightSum) &&
+ cards.length > 0
56
) {
57
//if random number is less than or equal to weight sum
58
randomCardOutput.innerText = `You got a ${card.rarity} card: ${card.name}`; //display generated random card
0 commit comments