{"id":624,"date":"2025-08-19T10:10:11","date_gmt":"2025-08-19T01:10:11","guid":{"rendered":"https:\/\/momospace.org\/?page_id=624"},"modified":"2025-11-16T00:21:06","modified_gmt":"2025-11-15T15:21:06","slug":"%ea%b2%8c%ec%9e%84%ec%a1%b4","status":"publish","type":"page","link":"https:\/\/momospace.org\/?page_id=624","title":{"rendered":"\ud559\uc2b5 \uac8c\uc784\uc874"},"content":{"rendered":"\n<!-- \uc6cc\ub4dc\ud504\ub808\uc2a4 \"\uc0ac\uc6a9\uc790 \uc815\uc758 HTML\" \ube14\ub85d \ud639\uc740 Elementor\/\ud50c\ub7ec\uadf8\uc778 HTML \uc704\uc82f\uc5d0 \ubd99\uc5ec\ub123\uc73c\uc138\uc694 -->\n<!DOCTYPE html>\n<html lang=\"ko\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\ud568\uc218 \ucd94\ub860 \uac8c\uc784<\/title>\n    <style>\n        @import url('https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;700&display=swap');\n        body { font-family: 'Inter', sans-serif; background-color: #f0f4f8; display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0; color: #1e293b; }\n        .game-container { background-color: #ffffff; border-radius: 1.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); padding: 2rem; text-align: center; max-width: 90%; width: 500px; box-sizing: border-box; border: 2px solid #e2e8f0; }\n        h1 { color: #334155; font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; }\n        .difficulty-selector { margin-bottom: 1.5rem; display: flex; justify-content: center; gap: 1rem; }\n        .difficulty-selector button { padding: 0.5rem 1rem; border: 2px solid #cbd5e1; background-color: #f8fafc; color: #475569; border-radius: 0.75rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease-in-out; }\n        .difficulty-selector button:hover { background-color: #e2e8f0; border-color: #94a3b8; }\n        .difficulty-selector button.selected { background-color: #3b82f6; color: white; border-color: #3b82f6; font-weight: 700; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3); }\n        #chart-container { width: 100%; height: 300px; background-color: #f8fafc; border-radius: 1rem; margin-bottom: 1.5rem; border: 1px solid #cbd5e1; position: relative; }\n        #chart-title { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 0.9rem; color: #64748b; font-weight: 600; }\n        #question-text { font-size: 1.25rem; font-weight: 600; color: #475569; margin-bottom: 1rem; min-height: 1.5rem; }\n        .buttons { display: flex; flex-direction: column; gap: 1rem; }\n        .button { padding: 1rem; background-color: #4a5568; color: white; border: none; border-radius: 0.75rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }\n        .button:hover { background-color: #2d3748; transform: translateY(-2px); box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); }\n        .button:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }\n        #result-message { margin-top: 1.5rem; font-size: 1.25rem; font-weight: 600; min-height: 1.5rem; }\n        @media (max-width: 600px) {\n            .game-container { padding: 1rem; width: 95%; }\n            h1 { font-size: 1.25rem; }\n            #question-text { font-size: 1.1rem; }\n            .button { padding: 0.8rem; font-size: 0.9rem; }\n            #chart-container { height: 250px; }\n            .difficulty-selector { gap: 0.5rem; }\n            .difficulty-selector button { padding: 0.4rem 0.8rem; font-size: 0.8rem; }\n        }\n    <\/style>\n<\/head>\n<body>\n<div class=\"game-container\">\n    <h1>\ud568\uc218 \ucd94\ub860 \uac8c\uc784<\/h1>\n    <div class=\"difficulty-selector\">\n        <button id=\"easy-btn\" class=\"selected\">\uc26c\uc6c0<\/button>\n        <button id=\"medium-btn\">\ubcf4\ud1b5<\/button>\n        <button id=\"hard-btn\">\uc5b4\ub824\uc6c0<\/button>\n    <\/div>\n    <div id=\"chart-container\">\n        <span id=\"chart-title\"><\/span>\n        <canvas id=\"myChart\"><\/canvas>\n    <\/div>\n    <div id=\"question-text\"><\/div>\n    <div class=\"buttons\"><\/div>\n    <div id=\"result-message\"><\/div>\n<\/div>\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n<script>\nwindow.onload = function() {\n    const chartContainer = document.getElementById('chart-container');\n    const canvas = document.getElementById('myChart');\n    const ctx = canvas.getContext('2d');\n    const chartTitleElement = document.getElementById('chart-title');\n    const questionTextElement = document.getElementById('question-text');\n    const resultMessage = document.getElementById('result-message');\n    const buttonsContainer = document.querySelector('.buttons');\n    const easyBtn = document.getElementById('easy-btn');\n    const mediumBtn = document.getElementById('medium-btn');\n    const hardBtn = document.getElementById('hard-btn');\n    let currentChart = null;\n    let currentDifficulty = 'easy';\n    const chartRange = 10;\n\n    function getRandomInt(min, max, exclude = []) { \n        let num;\n        do {\n            num = Math.floor(Math.random() * (max - min + 1)) + min;\n        } while (exclude.includes(num));\n        return num;\n    }\n    function getRandomFloat(min, max) { return Math.random() * (max - min) + min; }\n\n    function formatNumber(num) {\n        if (typeof num === 'string' && (num.startsWith('x=') || num.startsWith('y=') || num === '\uc5c6\uc74c')) return num;\n        if (typeof num !== 'number' || !isFinite(num)) return '\uc5c6\uc74c';\n        const tolerance = 1e-4; \n        if (Math.abs(num - 0.5) < tolerance) return '1\/2';\n        if (Math.abs(num - 1.5) < tolerance) return '3\/2';\n        if (Math.abs(num + 0.5) < tolerance) return '-1\/2';\n        if (Math.abs(num + 1.5) < tolerance) return '-3\/2';\n        if (Math.abs(num - Math.round(num)) < tolerance) return Math.round(num).toString();\n        return num.toFixed(2);\n    }\n\n    const resizeCanvas = () => {\n        canvas.width = chartContainer.offsetWidth;\n        canvas.height = chartContainer.offsetHeight;\n        if (currentChart) currentChart.resize();\n    };\n    window.addEventListener('resize', resizeCanvas);\n\n    const functionTemplates = {\n        polynomial: [\n            { type: '2\ucc28 \ud568\uc218',\n              formula: (a, b, c) => x => a * x * x + b * x + c,\n              params: () => {\n                  let a = getRandomInt(-2,2,[0]); if(a===0) a=1;\n                  return { a: a, b:getRandomInt(-4,4), c:getRandomInt(-5,5) };\n              },\n              getProperties: p => ({\n                  yIntercept: formatNumber(p.c),\n                  xIntercepts: p.b * p.b - 4 * p.a * p.c > 0 ? 2 : (p.b * p.b - 4 * p.a * p.c === 0 ? 1 : 0),\n                  concavity: p.a > 0 ? '\uc544\ub798\ub85c \ubcfc\ub85d' : '\uc704\ub85c \ubcfc\ub85d',\n                  asymptote: '\uc5c6\uc74c',\n                  max_value: p.a < 0 ? formatNumber(p.c - p.b*p.b\/(4*p.a)) : '\uc5c6\uc74c'\n              }) \n            },\n            { type: '\uc120\ud615 \ud568\uc218',\n              formula: (a, b) => x => a * x + b,\n              params: () => {\n                  let a = getRandomInt(-3,3,[0]); if(a===0) a=1;\n                  return { a: a, b: getRandomInt(-5,5) };\n              },\n              getProperties: p => ({\n                  yIntercept: formatNumber(p.b),\n                  xIntercepts: p.b === 0 ? '\ubb34\uc218\ud788 \ub9ce\uc74c' : 1,\n                  concavity: '\uc5c6\uc74c',\n                  asymptote: '\uc5c6\uc74c',\n                  slope: formatNumber(p.a)\n              }) \n            },\n            { type: '3\ucc28 \ud568\uc218',\n              formula: (a, b, c, d) => x => a * x * x * x + b * x * x + c * x + d,\n              params: () => {\n                  let a = getRandomInt(-1,1,[0]); if(a===0) a=1;\n                  return { a: a, b:getRandomInt(-2,2), c:getRandomInt(-3,3), d:getRandomInt(-5,5) };\n              },\n              getProperties: p => {\n                  const derA = 3 * p.a, derB = 2 * p.b, derC = p.c;\n                  const disc = derB * derB - 4 * derA * derC;\n                  let max_value = '\uc5c6\uc74c';\n                  if (disc > 0) {\n                      const r1 = (-derB - Math.sqrt(disc)) \/ (2 * derA);\n                      const r2 = (-derB + Math.sqrt(disc)) \/ (2 * derA);\n                      if (p.a < 0) max_value = formatNumber(p.formula(r1));\n                  }\n                  return { yIntercept: formatNumber(p.d), concavity: '\ubcc0\uace1\uc810\uc774 \uc788\uc74c', inflectionPoint: formatNumber(-p.b \/ (3 * p.a)), asymptote: '\uc5c6\uc74c', max_value: max_value };\n              },\n              getDerivative: p => x => 3 * p.a * x * x + 2 * p.b * x + p.c\n            }\n        ],\n        rational: [\n            { type: '\ubd84\uc218 \ud568\uc218',\n              formula: (a, b, c) => x => a \/ (x - b) + c,\n              params: () => {\n                  let a = getRandomInt(-5, 5, [0]); if(a===0) a=1;\n                  return { a: a, b: getRandomInt(-5,5), c: getRandomInt(-5,5)};\n              },\n              getProperties: p => ({\n                  yIntercept: p.b !== 0 ? formatNumber(p.a \/ -p.b + p.c) : '\uc5c6\uc74c',\n                  concavity: '\ubcc0\uace1\uc810\uc774 \uc5c6\uc74c',\n                  asymptote: 'x=' + formatNumber(p.b) + ', y=' + formatNumber(p.c)\n              })\n            }\n        ],\n        transcendental: [\n            { type: '\uc9c0\uc218 \ud568\uc218',\n              formula: (a, b, c) => x => a * Math.pow(b, x) + c,\n              params: () => {\n                  let a = getRandomInt(-3,3,[0]); if(a===0) a=1;\n                  return { a: a, b: getRandomFloat(1.2,1.8), c:getRandomInt(-5,5)};\n              },\n              getProperties: p => ({\n                  yIntercept: formatNumber(p.a + p.c),\n                  concavity: p.a > 0 ? '\uc544\ub798\ub85c \ubcfc\ub85d' : '\uc704\ub85c \ubcfc\ub85d',\n                  asymptote: 'y=' + formatNumber(p.c)\n              })\n            },\n            { type: '\ub85c\uadf8 \ud568\uc218',\n              formula: (a, c, d) => x => a * Math.log(x + c) + d,\n              params: () => {\n                  let a = getRandomInt(-3,3,[0]); if(a===0) a=1;\n                  return { a:a, c:getRandomInt(1,5), d:getRandomInt(-5,5)};\n              },\n              getProperties: p => ({\n                  yIntercept: p.c > 0 ? formatNumber(p.a * Math.log(p.c) + p.d) : '\uc5c6\uc74c',\n                  concavity: p.a > 0 ? '\uc544\ub798\ub85c \ubcfc\ub85d' : '\uc704\ub85c \ubcfc\ub85d',\n                  asymptote: 'x=' + formatNumber(-p.c)\n              })\n            },\n            { type: '\uc81c\uacf1\uadfc \ud568\uc218',\n              formula: (a, b, c) => x => a * Math.sqrt(x + b) + c,\n              params: () => {\n                  let a = getRandomInt(-2,2,[0]); if(a===0) a=1;\n                  return { a:a, b:getRandomInt(-4,4), c:getRandomInt(-5,5)};\n              },\n              getProperties: p => ({\n                  yIntercept: p.b >= 0 ? formatNumber(p.a * Math.sqrt(p.b) + p.c) : '\uc5c6\uc74c',\n                  concavity: p.a > 0 ? '\uc704\ub85c \ubcfc\ub85d' : '\uc544\ub798\ub85c \ubcfc\ub85d',\n                  asymptote: '\uc5c6\uc74c',\n                  domain: '[' + formatNumber(-p.b) + ', \u221e)'\n              })\n            },\n            { type: '\uc0bc\uac01 \ud568\uc218',\n              formula: (a, b) => x => a * Math.sin(x\/3) + b,\n              params: () => {\n                  let a = getRandomInt(1,3);\n                  return { a:a, b:getRandomInt(-2,2)};\n              },\n              getProperties: p => ({\n                  yIntercept: formatNumber(p.b),\n                  concavity: '\ubcc0\uace1\uc810\uc774 \uc788\uc74c',\n                  asymptote: '\uc5c6\uc74c',\n                  max_value: formatNumber(p.a + p.b)\n              })\n            }\n        ]\n    };\n    const problemTypes = {\n        easy: [\n            { question: 'x-\uc808\ud3b8\uc740 \uba87 \uac1c\uc778\uac00\uc694?', property: 'xIntercepts', generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(`${getRandomInt(0,3)}\uac1c`);\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: '\uadf8\ub798\ud504\ub294 \uc5b4\ub5a4 \ubcfc\ub85d\uc131\uc744 \uac00\uc9c0\ub098\uc694?', property: 'concavity', generateAnswers: ans => {\n                const o = ['\uc544\ub798\ub85c \ubcfc\ub85d', '\uc704\ub85c \ubcfc\ub85d', '\ubcc0\uace1\uc810\uc774 \uc788\uc74c', '\ubcc0\uace1\uc810\uc774 \uc5c6\uc74c', '\uc5c6\uc74c'];\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(o[getRandomInt(0, o.length - 1)]);\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: 'y-\uc808\ud3b8\uc758 \uac12\uc740 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'yIntercept', generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(formatNumber(getRandomInt(-5,5) + getRandomInt(0,1)*0.5));\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' }\n        ],\n        medium: [\n            { question: 'y-\uc808\ud3b8\uc758 \uac12\uc740 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'yIntercept', generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(formatNumber(getRandomInt(-5,5) + getRandomInt(0,1)*0.5));\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: '\uc774 \ud568\uc218\uc758 \uae30\uc6b8\uae30\ub294 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'slope', funcType: ['\uc120\ud615 \ud568\uc218'], generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(formatNumber(getRandomInt(-5,5)));\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' }\n        ],\n        hard: [\n            { question: '\uc774 \uadf8\ub798\ud504\uc758 \uc810\uadfc\uc120\uc740 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'asymptote', funcType: ['\ubd84\uc218 \ud568\uc218', '\uc9c0\uc218 \ud568\uc218', '\ub85c\uadf8 \ud568\uc218'], generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(`x=${formatNumber(getRandomInt(-5,5))}, y=${formatNumber(getRandomInt(-5,5))}`);\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: 'f(x)\ub294 \uc5b4\ub290 \uad6c\uac04\uc5d0\uc11c \uac10\uc18c\ud558\ub098\uc694?', property: 'decreasing_interval', funcType: ['3\ucc28 \ud568\uc218'], generateAnswers: ans => {\n                const o = ['(-\u221e, \u03b1)', '(\u03b2, \u221e)', '(\u03b1, \u03b2)', '\uac10\uc18c\ud558\uc9c0 \uc54a\uc74c'];\n                const s = new Set([ans]);\n                const f = o.filter(opt => !s.has(opt));\n                while (s.size < 4) {\n                    if(f.length === 0) break;\n                    s.add(f[getRandomInt(0, f.length - 1)]);\n                }\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\ub3c4\ud568\uc218' },\n            { question: 'f(x)\uc758 \ubcc0\uace1\uc810 x\uc88c\ud45c\ub294 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'inflectionPoint', funcType: ['3\ucc28 \ud568\uc218'], generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(formatNumber(getRandomInt(-5,5)));\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: '\uc774 \ud568\uc218\uc758 \ucd5c\ub313\uac12\uc740 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'max_value', funcType: ['2\ucc28 \ud568\uc218', '3\ucc28 \ud568\uc218', '\uc0bc\uac01 \ud568\uc218'], generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(formatNumber(getRandomInt(-5,5)));\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' },\n            { question: '\uc774 \ud568\uc218\uc758 \uc815\uc758\uc5ed\uc740 \ubb34\uc5c7\uc778\uac00\uc694?', property: 'domain', funcType: ['\uc81c\uacf1\uadfc \ud568\uc218'], generateAnswers: ans => {\n                const s = new Set([ans]);\n                while (s.size < 4) s.add(`[${formatNumber(getRandomInt(-5,5))}, \u221e)`);\n                return Array.from(s).sort(() => .5 - Math.random());\n            }, chartType: '\uc6d0\ud568\uc218' }\n        ]\n    };\n    function selectFunctionAndProblem() {\n        let funcTemplates, problemTemplates, selectedFunc, selectedProblem;\n        const allFuncs = Object.values(functionTemplates).flat();\n        if (currentDifficulty === 'easy') {\n            funcTemplates = functionTemplates.polynomial.filter(f => f.type === '\uc120\ud615 \ud568\uc218' || f.type === '2\ucc28 \ud568\uc218');\n            selectedFunc = funcTemplates[getRandomInt(0, funcTemplates.length - 1)];\n            problemTemplates = problemTypes.easy.filter(p => !p.funcType || p.funcType.includes(selectedFunc.type));\n            selectedProblem = problemTemplates[getRandomInt(0, problemTemplates.length - 1)];\n        } else if (currentDifficulty === 'medium') {\n            funcTemplates = allFuncs.filter(f => f.type !== '\uc81c\uacf1\uadfc \ud568\uc218' && f.type !== '\uc0bc\uac01 \ud568\uc218');\n            selectedFunc = funcTemplates[getRandomInt(0, funcTemplates.length - 1)];\n            problemTemplates = problemTypes.medium.filter(p => !p.funcType || p.funcType.includes(selectedFunc.type));\n            selectedProblem = problemTemplates[getRandomInt(0, problemTemplates.length - 1)];\n        } else { \/\/ hard\n            funcTemplates = allFuncs;\n            let selectedFuncIndex = getRandomInt(0, funcTemplates.length - 1);\n            selectedFunc = funcTemplates[selectedFuncIndex];\n            problemTemplates = problemTypes.hard.filter(p => !p.funcType || p.funcType.includes(selectedFunc.type));\n            if (!problemTemplates || problemTemplates.length === 0) {\n                const availableHardFuncs = allFuncs.filter(f => problemTypes.hard.some(p => !p.funcType || p.funcType.includes(f.type)));\n                if (availableHardFuncs.length > 0) {\n                    selectedFunc = availableHardFuncs[getRandomInt(0, availableHardFuncs.length - 1)];\n                    problemTemplates = problemTypes.hard.filter(p => !p.funcType || p.funcType.includes(selectedFunc.type));\n                }\n            }\n            if (!problemTemplates || problemTemplates.length === 0) {\n                return { selectedFunc: null, selectedProblem: null };\n            }\n            selectedProblem = problemTemplates[getRandomInt(0, problemTemplates.length - 1)];\n        }\n        return { selectedFunc, selectedProblem };\n    }\n    function generateGame() {\n        if (currentChart) currentChart.destroy();\n        resultMessage.textContent = '';\n        buttonsContainer.innerHTML = '';\n\n        const { selectedFunc, selectedProblem } = selectFunctionAndProblem();\n\n        if (!selectedFunc || !selectedProblem) {\n            currentDifficulty = 'easy';\n            [easyBtn, mediumBtn, hardBtn].forEach(b => b.classList.remove('selected'));\n            easyBtn.classList.add('selected');\n            return generateGame();\n        }\n        const params = selectedFunc.params();\n        let displayedFormula = selectedFunc.formula(...Object.values(params));\n        let chartTitle = 'y = f(x)';\n        let correctAnswer;\n        if (selectedProblem.chartType === '\ub3c4\ud568\uc218') {\n            chartTitle = \"y = f'(x)\";\n            displayedFormula = selectedFunc.getDerivative(params);\n\n            if (selectedProblem.property === 'decreasing_interval') {\n                const derA = 3 * params.a, derB = 2 * params.b, derC = params.c;\n                const disc = derB * derB - 4 * derA * derC;\n                if (disc > 0) {\n                    const r1 = (-derB - Math.sqrt(disc)) \/ (2 * derA);\n                    const r2 = (-derB + Math.sqrt(disc)) \/ (2 * derA);\n                    const minRoot = Math.min(r1, r2);\n                    const maxRoot = Math.max(r1, r2);\n                    correctAnswer = params.a > 0 ? `(${formatNumber(minRoot)}, ${formatNumber(maxRoot)})` : '\uac10\uc18c\ud558\uc9c0 \uc54a\uc74c';\n                } else {\n                    correctAnswer = '\uac10\uc18c\ud558\uc9c0 \uc54a\uc74c';\n                }\n            } else {\n                 correctAnswer = selectedFunc.getProperties(params)[selectedProblem.property];\n            }\n        } else {\n            correctAnswer = selectedFunc.getProperties(params)[selectedProblem.property];\n        }\n        const dataPoints = [];\n        const xRange = chartRange;\n        for (let i = 0; i <= 200; i++) {\n            const x = -xRange + (2 * xRange * i \/ 200);\n            try {\n                const y = displayedFormula(x);\n                if (selectedFunc.type === '\uc0bc\uac01 \ud568\uc218' &#038;&#038; i % 5 === 0) {\n                    dataPoints.push({ x: x * 3, y });\n                } else if (isFinite(y)) {\n                    if(Math.abs(y) < chartRange) {\n                        dataPoints.push({ x, y });\n                    }\n                }\n            } catch (e) {}\n        }\n\n        const answers = selectedProblem.generateAnswers(correctAnswer);\n\n        chartTitleElement.textContent = chartTitle;\n        questionTextElement.innerHTML = selectedProblem.question;\n\n        currentChart = new Chart(ctx, {\n            type: 'line',\n            data: { datasets: [{ data: dataPoints, borderColor: '#2563eb', borderWidth: 2, pointRadius: 0 }] },\n            options: { responsive: true, maintainAspectRatio: false, scales: { x: { type: 'linear', min: -xRange, max: xRange, grid: { color: c => (c.tick.value === 0 ? '#475569' : '#e2e8f0') } }, y: { type: 'linear', min: -xRange, max: xRange, grid: { color: c => (c.tick.value === 0 ? '#475569' : '#e2e8f0') } } }, plugins: { legend: { display: false }, tooltip: { enabled: false } } }\n        });\n        answers.forEach(answer => {\n            const button = document.createElement('button');\n            button.className = 'button';\n            button.innerHTML = answer;\n            button.onclick = () => checkAnswer(button, correctAnswer, selectedProblem);\n            buttonsContainer.appendChild(button);\n        });\n    }\n    function checkAnswer(clickedButton, correctAnswer, selectedProblem) {\n        buttonsContainer.querySelectorAll('.button').forEach(btn => {\n            btn.disabled = true;\n        });\n\n        const userAnswer = clickedButton.innerHTML;\n        const correctAnswerStr = (correctAnswer !== undefined && correctAnswer !== null) ? correctAnswer.toString() : '';\n        const correctAnswerWithUnit = correctAnswerStr.endsWith('\uac1c') ? correctAnswerStr : `${correctAnswerStr}\uac1c`;\n\n        let isCorrect = (userAnswer === correctAnswerStr || userAnswer === correctAnswerWithUnit);\n        if (isCorrect) {\n            resultMessage.textContent = '\uc815\ub2f5\uc785\ub2c8\ub2e4! \ud83c\udf89';\n            resultMessage.style.color = '#10b981';\n            clickedButton.style.backgroundColor = '#10b981';\n        } else {\n            const displayAnswer = selectedProblem.question.includes('\uc808\ud3b8\uc740 \uba87 \uac1c\uc778\uac00\uc694?') ? correctAnswerWithUnit : correctAnswerStr;\n            resultMessage.textContent = `\ud2c0\ub838\uc2b5\ub2c8\ub2e4. \uc815\ub2f5\uc740 '${displayAnswer}' \uc785\ub2c8\ub2e4.`;\n            resultMessage.style.color = '#ef4444';\n            clickedButton.style.backgroundColor = '#ef4444';\n            const allButtons = Array.from(buttonsContainer.querySelectorAll('.button'));\n            for (const btn of allButtons) {\n                if (btn.innerHTML === correctAnswerStr || btn.innerHTML === correctAnswerWithUnit) {\n                    btn.style.backgroundColor = '#10b981';\n                    break;\n                }\n            }\n        }\n        setTimeout(generateGame, 3000);\n    }\n\n    [easyBtn, mediumBtn, hardBtn].forEach(btn => {\n        btn.addEventListener('click', (e) => {\n            currentDifficulty = e.target.id.replace('-btn', '');\n            [easyBtn, mediumBtn, hardBtn].forEach(b => b.classList.remove('selected'));\n            e.target.classList.add('selected');\n            generateGame();\n        });\n    });\n    resizeCanvas();\n    generateGame();\n};\n<\/script>\n<\/body>\n<\/html>\n\n\n\n\n<p><br><br><br><br><\/p>\n\n\n\n<p><style>\n        @import url('https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;700&display=swap');<br \/>\n        body {<br \/>\n            font-family: 'Inter', sans-serif;<br \/>\n            background-color: #f0f4f8;<br \/>\n            display: flex;<br \/>\n            justify-content: center;<br \/>\n            align-items: center;<br \/>\n            min-height: 100vh;<br \/>\n            margin: 0;<br \/>\n            color: #1e293b;<br \/>\n        }<br \/>\n        .game-container {<br \/>\n            background-color: #ffffff;<br \/>\n            border-radius: 1.5rem;<br \/>\n            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);<br \/>\n            padding: 2rem;<br \/>\n            text-align: center;<br \/>\n            max-width: 90%;<br \/>\n            width: 500px;<br \/>\n            box-sizing: border-box;<br \/>\n            border: 2px solid #e2e8f0;<br \/>\n        }<br \/>\n        h1 {<br \/>\n            color: #334155;<br \/>\n            font-size: 1.5rem;<br \/>\n            margin-bottom: 0.5rem;<br \/>\n            font-weight: 700;<br \/>\n        }<br \/>\n        .difficulty-selector {<br \/>\n            margin-bottom: 1.5rem;<br \/>\n            display: flex;<br \/>\n            justify-content: center;<br \/>\n            gap: 1rem;<br \/>\n        }<br \/>\n        .difficulty-selector button {<br \/>\n            padding: 0.5rem 1rem;<br \/>\n            border: 1px solid #cbd5e1;<br \/>\n            background-color: #f8fafc;<br \/>\n            border-radius: 0.5rem;<br \/>\n            font-size: 0.9rem;<br \/>\n            cursor: pointer;<br \/>\n            transition: all 0.2s ease-in-out;<br \/>\n        }<br \/>\n        .difficulty-selector button.selected {<br \/>\n            background-color: #2563eb;<br \/>\n            color: white;<br \/>\n            border-color: #2563eb;<br \/>\n            font-weight: 700;<br \/>\n        }<br \/>\n        #chart-container {<br \/>\n            width: 100%;<br \/>\n            height: 300px;<br \/>\n            background-color: #f8fafc;<br \/>\n            border-radius: 1rem;<br \/>\n            margin-bottom: 1.5rem;<br \/>\n            border: 1px solid #cbd5e1;<br \/>\n            position: relative;<br \/>\n        }<br \/>\n        #chart-title {<br \/>\n            position: absolute;<br \/>\n            top: 10px;<br \/>\n            left: 50%;<br \/>\n            transform: translateX(-50%);<br \/>\n            font-size: 0.9rem;<br \/>\n            color: #64748b;<br \/>\n            font-weight: 600;<br \/>\n        }<br \/>\n        #question-text {<br \/>\n            font-size: 1.25rem;<br \/>\n            font-weight: 600;<br \/>\n            color: #475569;<br \/>\n            margin-bottom: 1rem;<br \/>\n            min-height: 1.5rem;<br \/>\n        }<br \/>\n        .buttons {<br \/>\n            display: flex;<br \/>\n            flex-direction: column;<br \/>\n            gap: 1rem;<br \/>\n        }<br \/>\n        .button {<br \/>\n            padding: 1rem;<br \/>\n            background-color: #4a5568;<br \/>\n            color: white;<br \/>\n            border: none;<br \/>\n            border-radius: 0.75rem;<br \/>\n            font-size: 1rem;<br \/>\n            font-weight: 600;<br \/>\n            cursor: pointer;<br \/>\n            transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;<br \/>\n            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);<br \/>\n        }<br \/>\n        .button:hover {<br \/>\n            background-color: #2d3748;<br \/>\n            transform: translateY(-2px);<br \/>\n            box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);<br \/>\n        }<br \/>\n        .button:active {<br \/>\n            transform: translateY(0);<br \/>\n            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);<br \/>\n        }<br \/>\n        #result-message {<br \/>\n            margin-top: 1.5rem;<br \/>\n            font-size: 1.25rem;<br \/>\n            font-weight: 600;<br \/>\n            min-height: 1.5rem;<br \/>\n        }<br \/>\n    <\/style><\/p>\n\n\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud568\uc218 \ucd94\ub860 \uac8c\uc784 \ud568\uc218 \ucd94\ub860 \uac8c\uc784 \uc26c\uc6c0 \ubcf4\ud1b5 \uc5b4\ub824\uc6c0 &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-624","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/momospace.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=624"}],"version-history":[{"count":67,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/624\/revisions"}],"predecessor-version":[{"id":835,"href":"https:\/\/momospace.org\/index.php?rest_route=\/wp\/v2\/pages\/624\/revisions\/835"}],"wp:attachment":[{"href":"https:\/\/momospace.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}