Hi here is my solution for Tic-Tac-Toe-game. I used HTML, CSS, JS.
What challenges did you encounter, and how did you overcome them?It was to create the CPU who plays against, to check all possibilities and take a decision depending on the game.
What specific areas of your project would you like help with?if(i === k && priorityPlay === 2 && !array[memoriseIndex]){ //playing priority means cpu plays to win array[memoriseIndex] = cpu.mark; document.querySelectorAll('.mark')[memoriseIndex].innerHTML = `<img class="player-mark" src=${ cpu.mark === 'X' ? './assets/icon-x.svg' : './assets/icon-o.svg' } alt="">`; memoriseIndex = 0; priorityPlay = 0; return; }
Feel free to leave any comments or playing the game.
Thanks.