diff --git a/public/index.html b/public/index.html index 2c57fd0..91b28b8 100644 --- a/public/index.html +++ b/public/index.html @@ -149,8 +149,9 @@ const leds = document.querySelectorAll('.led') for (let y = 0; y < 8; y++) { for (let x = 0; x < 8; x++) { - if (array[y][x] == 1) leds[i].classList.add('on') - else leds[i].classList.remove('on') + const n = y * 8 + x + if (array[y][x] == 1) leds[n].classList.add('on') + else leds[n].classList.remove('on') } } })