ගුණන වගු හරිම ලේසියි! - චක්කරේ (Let's Memorise Multiplication Table)
චක්කරේ හරිම ලේසියි!
O/L කරන ඔයාට ගුණන වගු ඇත්තටම ඕනෙ වෙන්නෙ සංඛ්යා දෙකක් ගුණ කරාම එන සංඛ්යාව මොකද්ද කියල දැනගන්නයි.
අපි දැනටමත් සංඛ්යා දෙකක් ගුණ කරන ක්රමවේදය දන්නව නම්, ඇත්තටම අපිට ඕනෙම සංඛ්යාවක ගුණිතය හොයන්න පුළුවන්. හැබැයි මෙතනදි ගොඩක් අයට මෙක කරන්න අපහසු, නැත්නම් ටිකක් වෙලා යන්නෙ එයාලට digits එකක් විතරක් තියෙන ඔනෙම සංඛ්යා දෙකක ගුණිතය ඉක්මනින් ගන්න බැරි නිසා.
<div class="lm-wrap">
<div class="lm-controls">
<label>Number 1:
<input type="number" id="lmA" min="10" max="99" value="67">
</label>
<label>Number 2:
<input type="number" id="lmB" min="10" max="99" value="23">
</label>
<button id="lmGo" type="button">Set numbers</button>
</div>
<div class="lm-stage">
<div class="lm-rows" id="lmRows"></div>
</div>
<div class="lm-callout" id="lmCallout">
Click <b>Next</b> to see how each digit gets multiplied, one at a time.
</div>
<div class="lm-nav">
<button id="lmBack" type="button">Back</button>
<button id="lmNext" type="button">Next</button>
<button id="lmReset" type="button">Reset</button>
</div>
</div>
<style>
.lm-wrap {
max-width: 460px;
margin: 24px auto;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
text-align: center;
}
.lm-controls { margin-bottom: 18px; font-size: 0.9rem; }
.lm-controls label { margin-right: 10px; }
.lm-controls input { width: 56px; padding: 4px 6px; font-size: 0.95rem; margin-left: 4px; }
.lm-controls button { padding: 5px 12px; font-size: 0.9rem; cursor: pointer; }
.lm-stage {
background: #fdeecb;
border-radius: 18px;
padding: 26px 20px 20px;
display: flex;
justify-content: center;
}
.lm-rows {
display: inline-flex;
flex-direction: column;
font-family: 'IBM Plex Mono', Consolas, monospace;
}
.lm-row { display: flex; justify-content: flex-end; }
.lm-carry-row { display: flex; justify-content: flex-end; height: 20px; }
.lm-carry-cell { width: 32px; display: flex; align-items: center; justify-content: center; }
.lm-carry-cell span {
font-size: 0.85rem;
font-weight: 700;
color: #d21f1f;
background: #fff2c9;
border-radius: 50%;
width: 18px; height: 18px;
display: flex; align-items: center; justify-content: center;
}
.lm-cell {
width: 32px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
font-weight: 700;
color: #111;
border-radius: 4px;
}
.lm-cell.red { color: #d21f1f; }
.lm-cell.dim { color: transparent; }
.lm-cell.highlight { background: #ffd24d; outline: 2px solid #d21f1f; }
.lm-divider { border-top: 3px solid #111; margin: 2px 0; }
.lm-callout { margin-top: 18px; font-size: 0.98rem; line-height: 1.5; color: #222; min-height: 44px; }
.lm-nav { margin-top: 14px; }
.lm-nav button {
padding: 7px 16px; margin: 0 5px; font-size: 0.9rem; cursor: pointer;
border-radius: 6px; border: 1px solid #999; background: #fff;
}
.lm-nav button:disabled { opacity: 0.4; cursor: default; }
</style>
<script>
(function () {
let a = 67, b = 23;
let step = 0;
const MAX_STEP = 7;
const rowsEl = document.getElementById('lmRows');
const calloutEl = document.getElementById('lmCallout');
const nextBtn = document.getElementById('lmNext');
const backBtn = document.getElementById('lmBack');
const resetBtn = document.getElementById('lmReset');
const goBtn = document.getElementById('lmGo');
const aInput = document.getElementById('lmA');
const bInput = document.getElementById('lmB');
function digits(n) {
const s = String(n);
return { ones: Number(s[s.length - 1]), tens: Number(s[s.length - 2]) };
}
function revealFromRight(str, count) {
if (count >= str.length) return str;
if (count <= 0) return '';
const visible = str.slice(str.length - count);
return ' '.repeat(str.length - count) + visible;
}
function padCells(str, totalCols) {
return str.padStart(totalCols, ' ').split('');
}
function makeRow(chars, opts) {
opts = opts || {};
const row = document.createElement('div');
row.className = 'lm-row';
chars.forEach(function (ch, i) {
const cell = document.createElement('div');
let cls = 'lm-cell';
if (ch === ' ') cls += ' dim';
if (opts.red) cls += ' red';
if (opts.highlightCol === i) cls += ' highlight';
cell.className = cls;
cell.textContent = ch === ' ' ? '' : ch;
row.appendChild(cell);
});
return row;
}
function makeCarryRow(totalCols, carryCol, carryValue) {
const row = document.createElement('div');
row.className = 'lm-carry-row';
for (let i = 0; i < totalCols; i++) {
const cell = document.createElement('div');
cell.className = 'lm-carry-cell';
if (i === carryCol && carryValue !== null) {
const span = document.createElement('span');
span.textContent = carryValue;
cell.appendChild(span);
}
row.appendChild(cell);
}
return row;
}
function render() {
rowsEl.innerHTML = '';
const ad = digits(a), bd = digits(b);
const a0 = ad.ones, a1 = ad.tens, b0 = bd.ones, b1 = bd.tens;
// ---- ones-digit pass (a x b0) ----
const prod1 = a0 * b0;
const d1 = prod1 % 10, carry1 = Math.floor(prod1 / 10);
const prod2 = a1 * b0 + carry1;
const partial1 = String(prod2) + String(d1);
// ---- tens-digit pass (a x b1), shifted with trailing 0 ----
const prod1b = a0 * b1;
const d1b = prod1b % 10, carryB = Math.floor(prod1b / 10);
const prod2b = a1 * b1 + carryB;
const partial2 = String(prod2b) + String(d1b) + '0';
const finalVal = Number(partial1) + Number(partial2);
const row1Str = String(a);
const row2Str = 'x' + String(b);
const row5Str = String(finalVal);
const totalCols = Math.max(
row1Str.length, row2Str.length, partial1.length, partial2.length, row5Str.length
) + 1;
const onesCol = totalCols - 1;
const tensCol = totalCols - 2;
const frames = [
{ msg: 'Click <b>Next</b> to see how each digit gets multiplied, one at a time.',
topH: null, botH: null, carry: null, r3: 0, r4: 0, r5: false },
{ msg: 'Multiply ' + a + ' by the <b>ones digit</b> of ' + b + ' (' + b0 + ').',
topH: null, botH: onesCol, carry: null, r3: 0, r4: 0, r5: false },
{ msg: a0 + ' × ' + b0 + ' = ' + prod1 + ' → write <b>' + d1 + '</b>, carry <b>' + carry1 + '</b>.',
topH: onesCol, botH: onesCol, carry: carry1, r3: 1, r4: 0, r5: false },
{ msg: a1 + ' × ' + b0 + ' = ' + (a1 * b0) + (carry1 ? ', plus the carried ' + carry1 + ' = ' + prod2 : '') + ' → write <b>' + prod2 + '</b>.',
topH: tensCol, botH: onesCol, carry: null, r3: partial1.length, r4: 0, r5: false },
{ msg: 'Put a <b>0</b> to hold the ones place, then multiply by the <b>tens digit</b> of ' + b + ' (' + b1 + ').',
topH: null, botH: tensCol, carry: null, r3: partial1.length, r4: 1, r5: false },
{ msg: a0 + ' × ' + b1 + ' = ' + prod1b + ' → write <b>' + d1b + '</b>, carry <b>' + carryB + '</b>.',
topH: onesCol, botH: tensCol, carry: carryB, r3: partial1.length, r4: 2, r5: false },
{ msg: a1 + ' × ' + b1 + ' = ' + (a1 * b1) + (carryB ? ', plus the carried ' + carryB + ' = ' + prod2b : '') + ' → write <b>' + prod2b + '</b>.',
topH: tensCol, botH: tensCol, carry: null, r3: partial1.length, r4: partial2.length, r5: false },
{ msg: 'Add the two rows: ' + partial1 + ' + ' + partial2 + ' = <b>' + finalVal + '</b>.',
topH: null, botH: null, carry: null, r3: partial1.length, r4: partial2.length, r5: true }
];
const f = frames[step];
rowsEl.appendChild(makeCarryRow(totalCols, tensCol, f.carry));
rowsEl.appendChild(makeRow(padCells(row1Str, totalCols), { highlightCol: f.topH }));
rowsEl.appendChild(makeRow(padCells(row2Str, totalCols), { highlightCol: f.botH }));
const divider1 = document.createElement('div');
divider1.className = 'lm-divider';
rowsEl.appendChild(divider1);
rowsEl.appendChild(makeRow(padCells(revealFromRight(partial1, f.r3), totalCols), { red: true }));
rowsEl.appendChild(makeRow(padCells(revealFromRight(partial2, f.r4), totalCols), { red: true }));
if (f.r5) {
const divider2 = document.createElement('div');
divider2.className = 'lm-divider';
rowsEl.appendChild(divider2);
rowsEl.appendChild(makeRow(padCells(row5Str, totalCols), { red: true }));
}
calloutEl.innerHTML = f.msg;
backBtn.disabled = step === 0;
nextBtn.disabled = step === MAX_STEP;
}
nextBtn.addEventListener('click', function () { if (step < MAX_STEP) { step++; render(); } });
backBtn.addEventListener('click', function () { if (step > 0) { step--; render(); } });
resetBtn.addEventListener('click', function () { step = 0; render(); });
goBtn.addEventListener('click', function () {
a = Math.min(99, Math.max(10, Number(aInput.value) || 67));
b = Math.min(99, Math.max(10, Number(bInput.value) || 23));
aInput.value = a; bInput.value = b;
step = 0;
render();
});
render();
})();
</script>
එහෙම බැලුවොත් අපිට අර සාමාණයෙන් 1 x 1 සිට 12 x 12 දක්වා තියෙන ඔක්කොම මතක තියාගන්න ඕනේ වෙන්නෙ නෑ. හැබයි ඔයාට දැනටමත් ඒ ඔක්කොම මතකයි නම් තවත් හොදයි.
පහලින් තියෙන වගුවේ මන් පෙන්නල තියෙනවා unique ගුණ කිරීම් ටිකක්. ඔයාට පෙනෙයි එතනදී මන් අරන් තියෙන්නෙ 1 x 1 සිට 9 x 9 දක්වා විතරයි කියල. එකට හේතුව ඔයාට දැන් පැහැදිලි ඇති. හේතුව තමයි අපිට සංඛ්යා ගුණ කරන්න අත්යාවශ්ය වෙන්නේ උපරිම 9 x 9 වෙනකම් විතරයි.
මේ ටික මතක තියාගන්න. පහලින් මන් රටා ටිකකුත් කියන්නම්. හැබැයි exam එකේදී ඔය ටික මතකෙන්ම ගන්න පුලුවන් නම් කාලය අනවශය විදිහට නාස්ති වෙන්නේ නෑ. අනික් දේ තමයි, ඔයා ගොඩක් ගණන් හදනකොට මේ වගේ සමහර සංඛ්යා ගුණ කිරීම් ඉබේම මතක හිටිනවා. මේ ටික පුළුවන් නම් ඊට පස්සේ 9 x13 වගෙ සාමන්යයෙන් මතක තියාගන්න ඔනේ නැති ඒවත් ගණන් හදනකොට දැකල ඉබේම මතක හිටිනවා.
රටා ටිකක්
- 1 න් ගුණ වෙන ඒවා ගැන අමුතුවෙන් කියන්න දෙයක් නෑනේ. ඒ හින්දා ඒ කොටු හිස් තිබ්බා.
- 2 න් ගුණ වෙන සංඛ්යා තමයි දෙවෙනි පේළියේ තියෙන්නේ. නිකන්ම දෙගුණ වෙනවා.
- 3 න් ගුණ වෙන සංඛ්යා තමයි තුන්වැනි පේළියේ තියෙන්නේ. මේවගේ විශේෂත්වය තමයි, ඉලක්කම් දර්ශකය හැම විටම 3, 6 හෝ 9 වෙනවා. ඔයාට තියෙන්නෙ කෙලින්ම 3න් ගුණ වෙන අනික් සංඛ්යාවේ දෙගුණය අරන්, එකට ගුණ කරන සංඛ්යාව එකතු කරල හිතන එක.
උදාහරණය: 3 x 4 = 4 x 3 = 4 x (දෙගුණය) + 4 = 8 + 4 = 12
- 4 න් ගුණ වෙන සංඛ්යා තමයි හතරවැනි පේළියේ තියෙන්නේ. ඔයාට තියෙන්නෙ සංඛ්යාව දෙගුණය අරන්, අයෙත් ඒකේ දෙගුණය ගන්න එක.
උදාහරණය: 4 x 7 = 2 x (2 x 7) = 2 x 14 = 28
- 5 න් ගුණ වෙන සංඛ්යා තමයි පස්වැනි පේළියේ තියෙන්නේ. ඒක ඇත්තටම ලේසි. හැම වෙලාවෙම එකස්ථානයේ 5 හෝ 0 තියෙන්නේ. නැත්තම් කෙලින්ම ගුණ කරන්න තියෙන සංඛ්යාව ට බිංදුවක් වැඩියෙන් හිතල (10න් ගුණ කරනවා), දෙකෙන් බෙදුන සංඛයාව ගන්න.
උදාහරණය: 5 x 7 = (7 x 10) / 2 = 70 / 2 = 35
- 9 න් ගුණ වෙන සංඛ්යා, අපි අන්තිම තීරුවෙන් හිතමු. හැම වෙලාවෙම ගුණිතයේ ඉලක්කම් (digit) දෙකේ එකතුව 9 යි. උදාහරණ: 9 x 2 = 18 (මෙහි 1 + 8 = 9). ඒ හින්දා අපිට රටාවක් පේනවා. 9 x 2 ආවම, මුලින් ගුණ වෙන සංඛාවෙන් එකක් අඩුකරල ලියල පටන් අරන් ඉලක්කම් එකතුව 9 වෙන්න හිග ඉලක්කම ඊට පස්සෙ ලියන්න පුලුවන්.
උදාහරණය: 9 x 7 = (7 - 1) ලියල, හිග ඉලක්කම (9-6) ලියන්න = 63
- අනෙක් විශේෂ සංඛ්යා ගුණිත නම් මතක තියාගන්න.
ඇත්තටම කීවොතින් මේ විදිහට ගොඩනගන විදි දැනගෙන අමතක වෙලාවට මෙහෙම ගන්න. කෙළින්ම ගණිත වගුවලින් බලන්නෙ නැතුව. එකකොට exam එක වෙනකොට නිකන්ම මේවා මතක හිටිනවා.
ඔයාට ලේසි වෙන්න මෙන්න මේ පහලින් තියෙන Flash cards style එකට උඩ වගුවම මන් දාලා තියෙනවා.
මොකක් හරි ගුණ කිරීමක අගය මනසින් සිතන්න. ඒ අගය හරිද බලන්න කොටුව ක්ලික් කරන්න. මේකෙන් ඔයාට මතක තියාගන්න එක game එකක් වගෙ කරන්න පුලුවන්.
<div class="mtg-wrap mtg-instance-1">
<div class="mtg-grid"></div>
</div>
<style>
.mtg-wrap {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
display: flex;
justify-content: center;
padding: 20px 0;
}
.mtg-grid {
--cell: 60px;
display: grid;
grid-template-columns: repeat(10, var(--cell));
grid-template-rows: repeat(10, var(--cell));
border: 2px solid #111;
}
@media (max-width: 640px) {
.mtg-grid { --cell: 34px; }
}
.mtg-cell {
width: var(--cell);
height: var(--cell);
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #d8d8d8;
font-weight: 700;
font-size: calc(var(--cell) * 0.32);
box-sizing: border-box;
}
.mtg-label { background: #fff; color: #111; }
.mtg-corner { background: #fff; color: #111; }
.mtg-blank { background: #fff; }
.mtg-card { perspective: 600px; cursor: pointer; border: none; padding: 2px; }
.mtg-inner {
position: relative; width: 100%; height: 100%;
transform-style: preserve-3d; transition: transform 0.45s ease;
}
.mtg-card.flipped .mtg-inner { transform: rotateY(180deg); }
.mtg-face {
position: absolute; inset: 0; display: flex;
align-items: center; justify-content: center;
backface-visibility: hidden; border-radius: 2px;
}
.mtg-back { transform: rotateY(180deg); }
</style>
<script>
(function () {
const root = document.currentScript.previousElementSibling.matches(".mtg-wrap")
? document.currentScript.previousElementSibling
: document.querySelector(".mtg-instance-1");
if (!root || root.dataset.mtgBuilt) return; // guard against double-execution
root.dataset.mtgBuilt = "true";
const grid = root.querySelector(".mtg-grid");
const cellColors = {
"2_2": "#FFE23B", "2_3": "#D3DEE8", "2_4": "#A9C99B", "2_5": "#E8B87E",
"2_6": "#FFE23B", "2_7": "#FFE23B", "2_8": "#FFE23B", "2_9": "#FFE23B",
"3_3": "#D3DEE8", "3_4": "#A9C99B", "3_5": "#E8B87E",
"3_6": "#C7D3F0", "3_7": "#C7D3F0", "3_8": "#C7D3F0", "3_9": "#C7D3F0",
"4_4": "#A9C99B", "4_5": "#E8B87E",
"4_6": "#A9C99B", "4_7": "#A9C99B", "4_8": "#A9C99B", "4_9": "#A9C99B",
"5_5": "#E8B87E", "5_6": "#E8B87E", "5_7": "#E8B87E", "5_8": "#E8B87E", "5_9": "#E8B87E",
"6_6": "#DFCEDF", "6_7": "#C093AC", "6_8": "#5C4B8C", "6_9": "#E619E6",
"7_7": "#B5524E", "7_8": "#E8362A", "7_9": "#E619E6",
"8_8": "#40E0F0", "8_9": "#E619E6",
"9_9": "#E619E6"
};
const FLIP_BACK_DELAY = 2200;
function contrastText(hex) {
const r = parseInt(hex.substr(1, 2), 16);
const g = parseInt(hex.substr(3, 2), 16);
const b = parseInt(hex.substr(5, 2), 16);
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
return luminance > 0.55 ? "#111111" : "#ffffff";
}
let cell;
cell = document.createElement("div");
cell.className = "mtg-cell mtg-corner";
cell.textContent = "X";
grid.appendChild(cell);
for (let c = 1; c <= 9; c++) {
cell = document.createElement("div");
cell.className = "mtg-cell mtg-label";
cell.textContent = c;
grid.appendChild(cell);
}
for (let r = 1; r <= 9; r++) {
cell = document.createElement("div");
cell.className = "mtg-cell mtg-label";
cell.textContent = r;
grid.appendChild(cell);
for (let c = 1; c <= 9; c++) {
const key = r + "_" + c;
const color = cellColors[key];
if (!color) {
cell = document.createElement("div");
cell.className = "mtg-cell mtg-blank";
grid.appendChild(cell);
continue;
}
const value = r * c;
const textColor = contrastText(color);
const card = document.createElement("div");
card.className = "mtg-cell mtg-card";
const inner = document.createElement("div");
inner.className = "mtg-inner";
const front = document.createElement("div");
front.className = "mtg-face mtg-front";
front.style.background = color;
const back = document.createElement("div");
back.className = "mtg-face mtg-back";
back.style.background = color;
back.style.color = textColor;
back.textContent = value;
inner.appendChild(front);
inner.appendChild(back);
card.appendChild(inner);
let hideTimer = null;
card.addEventListener("click", function () {
card.classList.add("flipped");
clearTimeout(hideTimer);
hideTimer = setTimeout(function () {
card.classList.remove("flipped");
}, FLIP_BACK_DELAY);
});
grid.appendChild(card);
}
}
})();
</script>