diff --git a/game.js b/game.js index 8c23e88..e16c26e 100644 --- a/game.js +++ b/game.js @@ -42,7 +42,7 @@ const getQuestionHTML = (state) => { return `what is the capital of ${state.question}?` } -const answer_list = Object.values(getMasterQuestionList()).map(item => item.answer); +const answer_list = () => Object.values(getMasterQuestionList()).map(item => item.answer); const regionList = [...new Set(Object.values(getMasterQuestionList()).map(item => item.region))] @@ -146,7 +146,7 @@ function updateState() { var newQuestion = questionList.pop(); var options = [] while (options.length < 4) { - var c = answer_list[Math.floor(Math.random()*answer_list.length)]; + var c = answer_list()[Math.floor(Math.random()*answer_list().length)]; if (c !== getMasterQuestionList()[newQuestion].answer && !options.includes(c)){ options.push(c); }