Hi @Angle Brace, I have searched so many other tutorials out there, which are very fancy and complicated. But I found your tutorial very helpful. As it finds easier for a beginner to understand and implement. Keep up the great work. 🤩
I’m having trouble with the interactive part. Everything was fine until you hopped onto JavaScript. My webpage isn’t responsive(not showing x or o when I click on the cells) Any suggestions?
Hello Everyone: Seems like after the player is won, the board still accepts the click events, so use the code below. See the comments with the code. let flag = false; checkForWinner = () => { if (check) { highlightCells(combination); flag = true; // make the flag true, if player has won. } } cells.forEach((cell) => { if (flag) { return } //if the player has won, then return.. else { cell.innerHTML = currentPlayer; /**After each move we need to check for the winner.. */ checkForWinner(); // before that create winning combinations.. currentPlayer = currentPlayer == 'X' ? 'O' : 'X' /* allow to change the player type after inserting, should be prevented.. */ } }
Which game should we create next?
home game light on and off or Math Game
Thanks For Your Great Tutorial
@@ncsgaming4093 Thanks I will try my best
@Angle Brace Chessboard. Thanks for your easy and understandable tutorial.
Thank you, very simple and easy to understand for beginners.
thank you brother....im a beginner and found your code very easy to understand....you makes me full clear
Hi @Angle Brace, I have searched so many other tutorials out there, which are very fancy and complicated. But I found your tutorial very helpful. As it finds easier for a beginner to understand and implement. Keep up the great work. 🤩
I am glad you liked it
I can't thank you enough for your support
One of the simplest tutorials on RUclips. Thanks!
I am glad you liked it
Great tutorial. Keep it up, brother 🖤
Many mant thanks
Thanks for the tutorial, really helpful, and you sound like a nice guy!
Thanks a lot it makes my day 💕
where did you learned coding bro.pls reply
I’m having trouble with the interactive part. Everything was fine until you hopped onto JavaScript. My webpage isn’t responsive(not showing x or o when I click on the cells)
Any suggestions?
X and O
U have to add it
its not alerting winner when winner did the combination, its alterting after other player plays
Nice :)
Well Thank you 💓
Hello Everyone:
Seems like after the player is won, the board still accepts the click events, so use the code below. See the comments with the code.
let flag = false;
checkForWinner = () => {
if (check) {
highlightCells(combination);
flag = true; // make the flag true, if player has won.
}
}
cells.forEach((cell) => {
if (flag) { return } //if the player has won, then return..
else {
cell.innerHTML = currentPlayer;
/**After each move we need to check for the winner.. */
checkForWinner(); // before that create winning combinations..
currentPlayer = currentPlayer == 'X' ? 'O' : 'X' /* allow to change the player type after inserting, should be prevented.. */
}
}
That's really helpful thanks for pointing out
it started to show every cell as X now