Showing
1 changed file
with
10 additions
and
1 deletions
... | @@ -363,7 +363,16 @@ function generateQuiz() { | ... | @@ -363,7 +363,16 @@ function generateQuiz() { |
363 | //#region 모스트 픽 챔피언 | 363 | //#region 모스트 픽 챔피언 |
364 | var firstPickChamp = champions[champList[0]]; | 364 | var firstPickChamp = champions[champList[0]]; |
365 | var secondPickChamp = champions[champList[1]]; | 365 | var secondPickChamp = champions[champList[1]]; |
366 | - | 366 | + for (i = 0; i < champList.length; i++) { |
367 | + if (champions[champList[i]] > secondPickChamp.totalGamePlay) { | ||
368 | + secondPickChamp = champions[champList[i]]; | ||
369 | + if (secondPickChamp.totalGamePlay > firstPickChamp.totalGamePlay) { | ||
370 | + var temp = secondPickChamp; | ||
371 | + secondPickChamp = firstPickChamp; | ||
372 | + firstPickChamp = temp; | ||
373 | + } | ||
374 | + } | ||
375 | + } | ||
367 | quizO = `${fakerData.name}가 대회에서 가장 많이 플레이한 챔피언은 '${firstPickChamp.name}'이다.`; | 376 | quizO = `${fakerData.name}가 대회에서 가장 많이 플레이한 챔피언은 '${firstPickChamp.name}'이다.`; |
368 | quizX = `${fakerData.name}가 대회에서 가장 많이 플레이한 챔피언은 '${secondPickChamp.name}'이다.`; | 377 | quizX = `${fakerData.name}가 대회에서 가장 많이 플레이한 챔피언은 '${secondPickChamp.name}'이다.`; |
369 | info = `1위. '${firstPickChamp.name}' : ${firstPickChamp.totalGamePlay}게임\n2위. '${secondPickChamp.name}' : ${secondPickChamp.totalGamePlay}게임`; | 378 | info = `1위. '${firstPickChamp.name}' : ${firstPickChamp.totalGamePlay}게임\n2위. '${secondPickChamp.name}' : ${secondPickChamp.totalGamePlay}게임`; | ... | ... |
-
Please register or login to post a comment