smukorez,
let blocks = document.querySelectorAll('.block');
let one = [];
let two = [];
for (let i = 0; i < blocks.length; i++){
two[i] = 'aqua';
let random = Math.round(Math.random());
if (random){
blocks[i].style.background = 'red';
one[i] = 'red';
}
else one[i] = 'aqua';
}
setTimeout(rel,1000);
for (let d = 0; d < blocks.length; d++){
blocks[d].onclick = function () {
blocks[d].style.background = 'red';
two[d] = 'red'
}
}
function rel() {
for (let i = 0; i < blocks.length; i++){
blocks[i].style.background = 'aqua';
}
}
let compare = () => one.every((v,i) => v === two[i]);