Skip to content

Commit eac61f8

Browse files
fix did-you-beat-the-bot logic
1 parent 52f734f commit eac61f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

assets/js/app/modals.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,21 +409,21 @@ Deckdle.modalOpen = async (type) => {
409409

410410
// win
411411
if (tableauCount == 0) {
412-
// check if our stock count is better than the bots score
413-
// (which will be a negative number for their stock count)
414-
if (stockCount > -botScore) {
412+
// check if our stock count is better than the bot score
413+
// flip stockCount so it's negative (bot score will be negative, too)
414+
if (-stockCount < botScore) {
415415
modalText += `
416416
<div>🤖🤖🤖</div>
417417
<div>You <strong>beat</strong> the bot! <em>How on earth...?!?!</em></div>
418418
<div>🤖🤖🤖</div>
419419
`
420-
} else if (stockCount == botScore) {
420+
} else if (-stockCount == botScore) {
421421
modalText += `<div>🤖 You matched the bot! <strong>Holy cowabunga!</strong> 🤖</div>`
422422
}
423423
}
424424
// loss
425425
else {
426-
// check if our tableau count is better than the bots score
426+
// check if our tableau count is better than the bot score
427427
// (which will be a positive number for their tableau count)
428428
if (tableauCount < botScore) {
429429
modalText += `

0 commit comments

Comments
 (0)