This commit is contained in:
Denis Monnerat 2025-02-03 10:53:11 +01:00
parent 4bc10860a5
commit abc0c9ae9f
2 changed files with 1 additions and 1 deletions
R4.01_R4.A.10/td_tp/tp2

Binary file not shown.

@ -45,7 +45,7 @@ function play(){
newBoard(size)
neighbors = calcNeighbours(size)
lights = document.querySelectorAll(".board span")
state = Array.from({length: size*size}, () => Math.random() < 0.5 ? true:false);
state = Array.from({length: size*size}, () => Math.random() < 0.5 ? 1:0);
state.forEach((el,i)=>{
if (el) lights[i].classList.toggle("off")
})