@@ -75,7 +75,7 @@ Deckdle.modalOpen = async (type) => {
7575 const finishedGamesFree = Deckdle . _getFinishedGameCount ( 'free' )
7676 const bestComboFree = Deckdle . _getBestCombo ( 'free' )
7777 const bestScoreFree = Deckdle . _getBestScore ( 'free' )
78- const botScoreDaily = await Deckdle . _getBotScore ( )
78+ const botScoreDaily = ( await Deckdle . _getBotScore ( ) ) . result . score
7979
8080 if ( Deckdle . myModal ) {
8181 Deckdle . myModal . _destroyModal ( )
@@ -95,7 +95,7 @@ Deckdle.modalOpen = async (type) => {
9595 <div class="statistic-setupid">
9696 ${
9797 Deckdle . __getState ( 'daily' ) [ 'setupId' ]
98- } <button class="fa-solid fa-robot icon tiny solo" title="${ botScoreDaily . score . trim ( ) } " onclick="Deckdle.modalOpen('bot-score')"></button>
98+ } <button class="fa-solid fa-robot icon tiny solo" title="${ botScoreDaily } " onclick="Deckdle.modalOpen('bot-score')"></button>
9999 </div>
100100 `
101101 }
@@ -345,7 +345,7 @@ Deckdle.modalOpen = async (type) => {
345345 break
346346
347347 case 'game-over' : {
348- const botScoreDaily = await Deckdle . _getBotScore ( )
348+ const botScoreDaily = ( await Deckdle . _getBotScore ( ) ) . result . score
349349
350350 if ( Deckdle . myModal ) {
351351 Deckdle . myModal . _destroyModal ( )
@@ -404,7 +404,7 @@ Deckdle.modalOpen = async (type) => {
404404 }
405405
406406 // did you beat the bot?
407- const botScore = parseInt ( botScoreDaily . score )
407+ const botScore = parseInt ( botScoreDaily )
408408
409409 // win
410410 if ( tableauCount == 0 ) {
@@ -483,7 +483,7 @@ Deckdle.modalOpen = async (type) => {
483483 <button class="game-over share" onclick="Deckdle._shareResults()">Share <i class="fa-solid fa-share-nodes"></i></button>
484484 </div>
485485 <div>
486- <button class="fa-solid fa-robot icon tiny solo" title="${ botScoreDaily . score . trim ( ) } " onclick="Deckdle.modalOpen('bot-score')"></button>
486+ <button class="fa-solid fa-robot icon tiny solo" title="${ botScoreDaily } " onclick="Deckdle.modalOpen('bot-score')"></button>
487487 </div>
488488 `
489489 }
@@ -629,11 +629,19 @@ Deckdle.modalOpen = async (type) => {
629629 }
630630
631631 const botScoreDaily = await Deckdle . _getBotScore ( )
632+ const score = botScoreDaily . result . score
633+ const max = botScoreDaily . result . max
634+ const min = botScoreDaily . result . min
635+ const mean = botScoreDaily . result . mean
636+ const median = botScoreDaily . result . median
637+ const mode = botScoreDaily . result . mode
632638
633639 Deckdle . myModalModal = new Modal (
634640 'perm-small' ,
635641 `Bot Score for ${ botScoreDaily . lastModified } ` ,
636- botScoreDaily . score ,
642+ `<div class="bot-meta">${
643+ score > 0 ? '+' + score : score
644+ } <br /><div class="bot-statistics">max: <strong>${ max } </strong>, min: <strong>${ min } </strong>, mean: <strong>${ mean } </strong>, median: <strong>${ median } </strong>, mode: <strong>${ mode } </strong></div></div>`,
637645 null ,
638646 null
639647 )
0 commit comments