
Solution retrospective
What are you most proud of, and what would you do differently next time?
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.
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;
}
What specific areas of your project would you like help with?
Feel free to leave any comments or playing the game.
Thanks.
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Lo-Deck's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord