How To Make Tic Tac Toe Game In React | Create Tic-Tac-Toe Using React JS

  Рет қаралды 105,081

GreatStack

GreatStack

Күн бұрын

Пікірлер: 89
@n0social
@n0social 10 ай бұрын
FINALLY MY FIRST REACT PROJECT THAT WORKS!
@orlandoferazzani3639
@orlandoferazzani3639 10 ай бұрын
works almost fine, but if you try it, you will see that you can put two elements on top of eachother, because it doesnt check if the box is empty
@warriorgaming4866
@warriorgaming4866 6 ай бұрын
🎯 Key points for quick navigation: 00:00 *🎮 Setting up Tic Tac Toe Game Board* - Setting up the initial game board with boxes that toggle between Cross and Circle icons. - Creating a reset button to clear the game board and start over. 01:48 *🛠️ Cleaning and Configuring React Project* - Removing default React project elements and renaming the project. - Configuring folder structure and basic setup for Tic Tac Toe component. 03:09 *🖼️ Adding Assets and Styling* - Importing and using game icons (Cross and Circle) from assets folder. - Setting up basic CSS for the game board, title, and reset button. 09:04 *⚙️ Implementing Game Logic: Toggle Functionality* - Implementing toggle functionality to switch between Cross (X) and Circle (O) icons on click. - Managing game state with a data array to track moves and check for a winner. 13:24 *🏆 Implementing Win Condition* - Creating a function to check for win conditions after each move. - Displaying a congratulations message and locking the board upon winning. 17:09 *🎉 Displaying Winner and Resetting the Game* - Updating the title with the winner's icon and message upon winning. - Adding functionality to reset the game board and title after a win or reset button click. Made with HARPA AI
@muhammadkausar2842
@muhammadkausar2842 2 ай бұрын
How do you do that brother?
@iftyrahman2239
@iftyrahman2239 Жыл бұрын
Thank you for this awesome tutorial ❤
@javirsagar8
@javirsagar8 15 күн бұрын
great and straightforward way😍
@easycodingwithbg4731
@easycodingwithbg4731 3 ай бұрын
Very Informative Sir 😘
@Eclipssed
@Eclipssed Жыл бұрын
Hey brother I really like your teaching style. A single request to make a playlist of react so that it becomes easy to access react videos only. Pleazzzzzzzzzzzzzzzzzzzzz🙏
@Zetsu1307
@Zetsu1307 11 ай бұрын
Great, bu there will be a bug in this game, that is once you double click on already selected box you can again do the same move. I mean, if you click once a box and you get cross, thenagain click on the same box, and then try clicking another block, you will get cross again but whereas you should get a circle.
@JaikumarLohana-v4t
@JaikumarLohana-v4t 4 ай бұрын
if (count%2==0) { if(data[num] === "" ){ e.target.innerHTML=`` data[num]="x" setCount(count+1) } } if (count%2!=0) { if(data[num] === "" ){ e.target.innerHTML=`` data[num]="O" setCount(count+1) } } checkwin() } this will do
@franciskp9117
@franciskp9117 9 ай бұрын
You videos are alright. A bit more explanation would be great. As a beginner I don't understand, why some steps are done in your tutorial.
@AlejandroMéndez-j6j
@AlejandroMéndez-j6j 9 ай бұрын
Dam, some bad practices here (inerhtml, writing the blocks one by one, writing EVERYTHING in one file, box i is also box i-1...) But it was helpful as some way to start.
@abhinavgupta1219
@abhinavgupta1219 Жыл бұрын
This is awesome tutorial, i can now easily make tic tac toe game. Thanks for this ❤ best yourube channel to learn frontend development.
@dymphna_creates
@dymphna_creates Жыл бұрын
Nice tutorial 😊
@TheEnd-m5w
@TheEnd-m5w 2 ай бұрын
Thankyou sir
@GreatStackDev
@GreatStackDev 2 ай бұрын
You're welcome. 😊 Keep coding.
@TheEnd-m5w
@TheEnd-m5w 2 ай бұрын
Sir thankyou for Your response Sometimes I feel very demotivated I think I am lost my family ,relations bcz lack of IT job 😅. Again thanks to you for your coding contribution on KZbin sir❤
@NikhilPawar151
@NikhilPawar151 Жыл бұрын
Thank you for such valuable content.
@SandeepMR26
@SandeepMR26 Жыл бұрын
Awesome keep it up . .
@feekz8590
@feekz8590 7 ай бұрын
i tried following your code but i have 'useState' is not defined no-undef error popping up.
@dancepractice805
@dancepractice805 Жыл бұрын
It was very useful
@joshuasappor5435
@joshuasappor5435 Жыл бұрын
nice tutorials but please with the rows in the board i think it show be column instead. So maybe column1, column2, column3 because it almost confused me when i opened in the developer tools with chrome
@ArshaqAk
@ArshaqAk Жыл бұрын
It is not working properly
@govindsharma973
@govindsharma973 10 ай бұрын
Bhai tumne data array ko tictac ka function hai na usse bahar karo sayad kaam kar jaye ye
@palanimathi4493
@palanimathi4493 Жыл бұрын
Thanks for this video, Need a Javascript video continuation....
@tebiksingh
@tebiksingh Жыл бұрын
Love and guidance ❤
@prakashchalke1708
@prakashchalke1708 Жыл бұрын
Wonderful, friend.
@devrimsarikaya
@devrimsarikaya 11 ай бұрын
çok teşekkürler :)
@HamzaSuleman-u4m
@HamzaSuleman-u4m Жыл бұрын
Line 11:23: 'useState' is not defined no-undef Line 12:22: 'useState' is not defined no-undef Line 20:13: 'e' is not defined no-undef Line 25:13: 'e' is not defined i am having the above issue help me
@jasongutierrez2548
@jasongutierrez2548 Жыл бұрын
At 9:29 const toggle = (e,num) =>{ replace w with e
@salimbendag6274
@salimbendag6274 Жыл бұрын
and for useState you need to import it " import { useState } from 'react'; "
@FullSTACKDev16
@FullSTACKDev16 Жыл бұрын
cool game making bro
@mahkamov_9
@mahkamov_9 3 ай бұрын
Thank You
@soumyajeetbiswal8401
@soumyajeetbiswal8401 4 ай бұрын
3:50 I'm not getting that automatically 😅 it's not importing...need help
@pruthivirajrao2976
@pruthivirajrao2976 6 ай бұрын
which website you not made pls tell whenever i search any react related query i always found your channel
@yashlad9412
@yashlad9412 Жыл бұрын
At timestamp 16:50, In TicTackToe Component, Why have you repeated the code from line 61 to 64?
@economicblast
@economicblast Жыл бұрын
Change data values.
@tarun7453
@tarun7453 Жыл бұрын
Nice project made it but if I click at same postion more than once the output is different
@ParallelXL
@ParallelXL Жыл бұрын
Hey I am here after like years, And I just remembered from Whom I used to learn back in those days So I searched easy tutorials and yeah Why yall changed the name and are there multiple teachers now?
@GreatStackDev
@GreatStackDev Жыл бұрын
Hi Ayan, Thanks for coming back. I find GreatStack more relevant to the content we make. Yes, now we are working as a team. Btw, I really liked your Netlify portfolio site.
@Letsplayxxs
@Letsplayxxs Жыл бұрын
​@@GreatStackDevhow to create username and highest score in sec.
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd Жыл бұрын
thank you
@clouduro5227
@clouduro5227 6 ай бұрын
If the game results in a tie, then upon clicking on the reset button it gives error!
@MaulanaRafinda-r8l
@MaulanaRafinda-r8l Жыл бұрын
Thanks...
@heyyangshuman
@heyyangshuman Жыл бұрын
npm create-react-app . is taking hours to install. What should I do?
@User123_00__
@User123_00__ Жыл бұрын
First you need to install node js on your system
@pratishrutisahoo7
@pratishrutisahoo7 11 ай бұрын
npm create vite@latest
@aswinkrishna9783
@aswinkrishna9783 11 ай бұрын
why images are not showing when i import
@AhmadHassan-o6f
@AhmadHassan-o6f 4 ай бұрын
Ap me image Ka path nhi dia ho ga ap ise public ke app SE import karva do
@Nanashi-rq7lk
@Nanashi-rq7lk Жыл бұрын
Nice
@mdsabbirhossen884
@mdsabbirhossen884 Жыл бұрын
Do you need channel seo manager?
@Unstableaspirant
@Unstableaspirant 3 ай бұрын
i m doing the same but titleRef is undefined showing what should i do
@VedantKumbharkar-f2x
@VedantKumbharkar-f2x Ай бұрын
you must have written let titleRef= useRef(null); so above write import{useRef} from "react"; it would work
@loser8198
@loser8198 Жыл бұрын
Awesome
@opivcm4566
@opivcm4566 Жыл бұрын
guys i am getting error in @4:44
@A11-b6e4s
@A11-b6e4s Жыл бұрын
Bro on the next Please make a video about full stake freelancer website
@ibrohimismoilov8345
@ibrohimismoilov8345 Жыл бұрын
hi bro there is bug, where i finished game with toe. You haven't checked this situation.
@pain5772
@pain5772 Жыл бұрын
Sir my output is showing error that e is not defined and useRef is not defined why is that
@FesiBaya
@FesiBaya Жыл бұрын
useRef should be inside: const TicTacToe = () => { let titleRef = useRef(null); } and in return ( Tic Tac toe Game In React )
@arunkumar-pr1rg
@arunkumar-pr1rg 9 ай бұрын
You need to explain the conditions which you are using and why you are using You are just saying we will set ,we will create ., but need to explain why it is needed there
@SBamniya
@SBamniya Жыл бұрын
Good try, keep it up, I would suggest to study more about the logics before making video. You don't need multiple references for reset, you can do it in better way without multiple reference, the data that you stored could be a state, the conditions are really messed. The counter update is not the correct way either, lots if duplicacy.
@ashwinchavhan860
@ashwinchavhan860 Жыл бұрын
hiiiii
@rachappajiachar5062
@rachappajiachar5062 Жыл бұрын
how to create mulitple product details page in single html page using JavaScript please reply sir
@manideepmaturi4682
@manideepmaturi4682 2 ай бұрын
Connecting and retrieving the data from mongo db for these pages
@omsatishthanage6083
@omsatishthanage6083 10 ай бұрын
how to add draw condition?
@titikshyachanda8623
@titikshyachanda8623 Жыл бұрын
Why does my toggle function not working?
@govindsharma973
@govindsharma973 10 ай бұрын
Listen tumne data array ko sayad tictac toe ka component ke upar declarr karo chal jayega
@Spinrider1817
@Spinrider1817 10 ай бұрын
Reset the counter on reset
@dipankarpaul3405
@dipankarpaul3405 Жыл бұрын
Please make some videos with Svelte or SvelteKit...
@sonalkhapre5716
@sonalkhapre5716 Жыл бұрын
How to add draw msg, if there is draw?
@rashmithagudipudi5979
@rashmithagudipudi5979 Жыл бұрын
create variable like is draw let isDraw=false; then modify cheeckwin with include the draw condition else if (!data.includes("")) { . isDraw = true; setLock(true); titleRef.current.innerHTML = 'It\'s a Draw!'; }
@kondisettysaidheeraj4276
@kondisettysaidheeraj4276 7 ай бұрын
bro you are missing the condition that if the game draws .
@ashumishra2330
@ashumishra2330 5 ай бұрын
What if we do designing this from Tailwind CSS Ans: It will become FAST AND FURIOUS😅
@eugeneokaka
@eugeneokaka Жыл бұрын
more react content
@wiccanmarvelous
@wiccanmarvelous Жыл бұрын
pls provide your Git hub link
@KondisettySaidheeraj
@KondisettySaidheeraj 7 ай бұрын
Please provide git link
@KondisettySaidheeraj
@KondisettySaidheeraj 7 ай бұрын
Bro can you send code please.
@aztra_01
@aztra_01 Жыл бұрын
What if the game gets a Draw?
@User123_00__
@User123_00__ Жыл бұрын
Good question
@Hashek
@Hashek 10 ай бұрын
then just reset lmao
@fast_develop
@fast_develop Жыл бұрын
Lol, react documentation game
@Examplist
@Examplist Жыл бұрын
bad pronounciation, couldnt understand words 9:24
@AlejandroMéndez-j6j
@AlejandroMéndez-j6j 9 ай бұрын
Oh, poor of you, 1 work stoped you. Go an learn some English so 1 word doesn't stop you next time. No problem for me.
@atulmourya7130
@atulmourya7130 9 ай бұрын
bugs alert! if you try to click again the box which is already clicked you will get an error and the count of value is increament as well. use bellow fixed toggle method to escape the issue! const toggle =(e,num)=> { if(lock){ return 0; } if (count%2 === 0){ e.target.innerHTML = ``; if(data[num] === "" ){ data[num] = "x"; setCount(++count); } } else{ e.target.innerHTML = ``; if(data[num] === "" ){ data[num] = "o"; setCount(++count); } } checkwin(); }
@TheSachinAlam
@TheSachinAlam 5 ай бұрын
great
@smartandrew2362
@smartandrew2362 2 ай бұрын
const reset = ()=>{ setLock(false); // let data = ["","","","","","","","",""]; data.fill(""); titleRef.current.innerHTML = 'Tic Tack Toe Game In React' boxArray.map((e) =>{ e.current.innerHTML = ""; }) setCount(0); } this help to solve me the bug which is when i resets the game and make one move instanly it satys wins
A game of TicTacToe written in JavaScript ⭕
18:57
Bro Code
Рет қаралды 132 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Making Games with Javascript and React
33:32
Mark Makes Stuff
Рет қаралды 82 М.
Beautiful Tic Tac Toe game using HTML, CSS and JavaScript - Code Hawk
14:38
Learning React, Typescript, Tailwind and Vite with Tic Tac Toe
28:33
ReactJS Tic Tac Toe (FAST and MODERN Tutorial)
7:33
A Software Engineer
Рет қаралды 24 М.
5 Secrets to Stop Stuttering & Speak More Clearly!
12:44
Vinh Giang
Рет қаралды 91 М.
Socket.io + ReactJS Tutorial | Learn Socket.io For Beginners
32:35
This is the Only Right Way to Write React clean-code - SOLID
18:23
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН