I absolutely loved your explanation sir. I thought of making this game from last 5 months, but I couldn't make it. I decided to make a game till the end of 2021. So I sat at 11:30pm on 31st dec 2021, I saw the TITLE of the video is interesting and started watching, It was so impressive and I started making own cases and started writing code. I divided the progress of game into small parts/tasks and Finally at 1:30 I completed. However the code is very big. But the game is just with if else and loops. I was motivated a lot with this video and just wanted to share. Thank you very very very very much sir. And make some more logical videos like this. STAY SAFE.
@abhinavchauhangujjar64565 жыл бұрын
And Sir, we don't have to check anything until any of zero or cross move at least 3 times, in other words at least 5 box should be filled or 4 moves should pass before doing any checking, and i observed that first mover can play at most 5 times and second mover can play at most 4 times, can we use that fact for efficiency.
@SichuunduW7624 жыл бұрын
hello! look at this.making use of a two dimensional array,write the code that permits two players to play a game of tic tac toe (also known as noughts and crosses). use 0 to represent an empty square.1 to represent a cross, and 2 to represent a nought. this requires implementing several algorithms; asking for the user`s input and placing their symbol looping between two different players alternating the symbol checking for a win. must be done in java. show the pseudocode and the java code
@tejaswipandava4 жыл бұрын
Ya, I was also thinking the same thing. The first thing we need to do is have an if the check for the total no of turns in case they exceed 4. if they exceed we can start our logic. Also, one more idea I was getting is instead of having 8 checks (row, column, and diagonals) why not reduce the check. I mean when ever a user selects a value (say position 8) let's check all possible combinations with that position that would reduce the checks to max 3. (positions [0,4,8],[2,5,8][6,7,8])
@anshpng5 жыл бұрын
We can make the code more efficient by creating a 3x3 matrix from a 2D array and then running 2 loops to check conditions for horizontal and vertical boxes.
@samantasunanda Жыл бұрын
Even your comment hold O(n^2) time complexity, writing small code makes it efficient?
@clasherdamn58622 жыл бұрын
I am learning react and yess I am at tic tac toe chapter and I got the logic now heading back It's such a great explanation 👍🏻
@supentamu3073 Жыл бұрын
Great job Hitesh Marvellously simple . I loved it .😍
@venkateshnambi15764 жыл бұрын
came hear to build this game in react .. Basics first! then next!!!
@vivekshukla94853 жыл бұрын
Came here while learning Angular from LCO. I was concerned how we will do it but the way you explained was really awesome!
@jayeshfirke15075 жыл бұрын
Its really simple logic to understand pls make more stuff like that
@anonyone8834 Жыл бұрын
How are you everywhere??????
@TunsalatOgTomat4 жыл бұрын
jeez you made that easy, thank you bhaee... greetings from denmark :)
@mdwaqar47025 жыл бұрын
Just thinking about that and not wanted to take any kind of help from internet but as I don't want to miss any of your video. I watched it and its damn simple logic.
@kunalkathe31985 жыл бұрын
That thumbnail is really catchy! 😀 Video👌👌
@nayhamanzoor18484 жыл бұрын
I'm designing tic tac toe in Oracle development.....love this video ....it clears my logic ... thank you sir
@yashrajanshukla77905 жыл бұрын
8:29 sir haven't cut that seen because he want to show that yes professionals also makes mistakes That builds a connection between teacher and students But it's he didn't hide the mistakes he accepted it Salute you sir
@priyanshusharma23103 жыл бұрын
I came here from your react course :), your course is really good
@vinodagoudapatil15173 жыл бұрын
From your Angular course, I am here!
@mockingbird38095 жыл бұрын
Who Came From Flutter Course in Learn Code Online?..😉
@isac.2h4 жыл бұрын
Not me :D
@NIKHIL27B3 жыл бұрын
From angular
@mohitchaudhari33983 жыл бұрын
from React
@coolpot3 жыл бұрын
this guy is great, his udemy on angular is what everyone else should aspire to, also i often have trouble understanding indian accents on courses, but this guy has amazing english language speaking ability and his courses are to the point - new favourite of mine :)
@aheribanerji70563 жыл бұрын
Which course??
@RudraprasadMohapatraa2 ай бұрын
I came here from React Native Series Tic Tac Toe app, thought like something heavy like DP will be applied 😁but it was too simple. Thank You Sir.☺
@ravigunz5 жыл бұрын
come here from LCO's, complete flutter course, simply amazing explanation. thank you!
@asimtarapathak86485 жыл бұрын
Loved this video ❤️. It's was so easy and simple logic.
@RandomGuy-hi2jm5 жыл бұрын
*Can we optimize this problem? DS*
@tejaswipandava4 жыл бұрын
optimization: The first thing we need to do is have an if the check for the total no of turns in case they exceed 4. if they exceed we can start our logic. Also, one more idea I was getting is instead of having 8 checks (row, column, and diagonals) why not reduce the check. I mean whenever a user selects a value (say position 8) let's check all possible combinations with that position that would reduce the checks to max 3. (positions [0,4,8],[2,5,8][6,7,8])
@hassaan-dev Жыл бұрын
💜You explained easily difficult logic
@visheshgupta499011 ай бұрын
Thank you so much sir the way you explain it looks how simple and I am able to understand this logic and able to think thanks alot , I came up here from your react native series
@9-HYPERTREND5 жыл бұрын
dear sir tell me about block chain technology whether this technology behind bitcoin or not?
@alittlecoding5 жыл бұрын
yes, sir. blockchain technology is behind bitcoin.
@sujaypagam1149 Жыл бұрын
💌🤟 logic 🔥 Learning react js from lco... and just loved it
@benelansari7228 Жыл бұрын
Could you tell me how to improve my problem skills and solve problems like tic-tac-toe in a eaier way? thank you
@ranjandass135 жыл бұрын
I thought you're going to explain some logic or algorithm where the computer will win every time or something like that. Some intelligent comp player.
@AbhishekJain-zu1uf5 жыл бұрын
Me too
@ranuranjan79373 жыл бұрын
who came from reactjs course?, sir logic too simple and very helpful
@shivsingh5117 Жыл бұрын
Now, After watching the video "It is very simple"❤❤🙏🙏
@AmitSingh-nr8jz5 жыл бұрын
no need to scan all rows , cols & diagonals to decide winning state, if u changed any cell and it is not corner cell then just check corresponding row & col, else you will have to consider corresponding diagonal as well . so in after each u have to either check for (row & col) or (row, col & dig) to decide winning state. this question is not about how do u decide winning state after each move, it is more how efficiently u decide :)
@AkshayGupta-dd4ht4 жыл бұрын
this logic is tooooooooo simple for noobs . thanks you and for legends minimax algo
@MohitK965 жыл бұрын
I still remember that because of this fu@#ing problem I left learning java and app development. I was learning on my own, doing Head first java, everything was going smooth and then this problem appeared, wasted almost 4-5 days, was lost in college stuff and ultimately never did again...
@AmanKumar-tv1yl4 жыл бұрын
Hi Hitesh, You are simply amazing. You have the skills to make complex things easy to understand.
@sigmaboom3324 жыл бұрын
The explanation is very easy Thank you
@kishankewal8835Ай бұрын
i came from your react native video. A request please add link in all videos where you are sharing this video
@souvikbanerjee16355 жыл бұрын
In C pos[i] will be filled up with garbage value if the player have not played any move there so we can simply check (for the horizontal case) if pos[0]==pos[1] and pos[1]==pos[2] so if the player have not filled out any of the places it will not match anyway because of the garbage value concept. I tried to code that with this logic and found some strange error which says that the subscripted value is not either array nor pointers nor vectors . I just want to know if I am thinking correctly , and this error is occurring because of my logic or not.
@swarajgadre56303 жыл бұрын
Very nicely explained sir!!!!!!!
@darshanthakral55055 жыл бұрын
Was actually stuck at that point, Thanks for helping us..😊😊
@SichuunduW7624 жыл бұрын
nice one. here is a question.making use of a two dimensional array,write the code that permits two players to play a game of tic tac toe (also known as noughts and crosses). use 0 to represent an empty square.1 to represent a cross, and 2 to represent a nought. this requires implementing several algorithms; asking for the user`s input and placing their symbol looping between two different players alternating the symbol checking for a win. must be done in java. show the pseudocode and the java code
@ron37993 жыл бұрын
Couldn't you do if pos[0] == pos[1] == pos[2] instead?
@maelstrom573 жыл бұрын
You couldn't. A computer would interpret pos[0] == pos[1] == pos[2] as ( pos[0] == pos[1] ) == pos[2] namely true/false == pos[2]
@ron37993 жыл бұрын
@@maelstrom57 thank u
@bhalsodnirva1045 жыл бұрын
OMG...started loving yr channel more...😍😍😍😍That was so easy and interesting..plz plz plz add videos like this to build the logic..humble request
@shoaibhasan4026 Жыл бұрын
Thank you so much you're life saver Sir everytime ❤
@zakiulhasan8085 жыл бұрын
Sir what kind of glass you are using.Is it any blue light protection glass? Do we have to use that kind of product?
@abhinavsinha99233 жыл бұрын
Yea it was very interesting and very enjoyable! Cool HC!
@Himachaliyan4 жыл бұрын
Can we make it shorter and simple..
@edtechbymeera4 жыл бұрын
Fantastic explanation of the logic..Programming is all about conceptual thinking and analysis rather than coding. You are great
@manivelarung4 жыл бұрын
came from Hitesh's Angular course
@ritiksaxenaofficial5 жыл бұрын
When I started learning C++... I made it using array and lots of *if* and *else* statements. But this logic is quite simple✌🏻
@jayanthm25975 жыл бұрын
Thank you,my everyday challenges and doubts are always solved by you...
@unpluggedaman5 жыл бұрын
Great, could you do a similar video for the Simon Game logic as well!
@sail_sail305 жыл бұрын
What if we do it like this? We use magic squares. 6 1 8 7 5 3 2 9 4 In any direction the sum is 15, hence is the winning logic.
@harshagarwal38555 жыл бұрын
This logic can really work if there ain't any other 3 letter combination giving 15
@sail_sail305 жыл бұрын
Yes i have tested it always gives 15 in any direction, vertical, horizontal or diagonal
@varishali14005 жыл бұрын
Sir can you please show me how to implement computer mode in this game?
@hrithikchavva61275 жыл бұрын
I loved this video !!! Thank u sir for letting me know how to go for standard approach for such problems
@Rishi-xj2iy2 жыл бұрын
your personality reflects some shade of professor from money heist spain
@jaypatel93924 жыл бұрын
Yes I have enjoyed.plz make this kind of videos
@farhan7875 жыл бұрын
8:28 both time wrong sir "Tic toc tae" and "tic-toc-tech", it happens but I really liked that you didn't cut that part.
@HiteshCodeLab5 жыл бұрын
😂
@yashrajanshukla77905 жыл бұрын
Absolutely simple .. And this video will help beginners to understand it better
@AkshayMohanty7432 жыл бұрын
Great way of teaching 😊
@SunilKumar-ib2bq Жыл бұрын
Amazing explaination!
@TopAPPSTamil5 жыл бұрын
omg more time i did nt realize and still 5.30pm what logic is this ?? but now i got it😍😍😍 plzzz doooooo more more this kind of videoo dude
@HiteshCodeLab5 жыл бұрын
I am known for making things simple. 🙂
@msdhaliwal4 жыл бұрын
creating react app from your latest react course at LCO ( complete reactJs developer bootcamp )
@BeyondRecognitionLifestyle5 жыл бұрын
You made this really easy to understand. Thank you!
@wrednax85944 жыл бұрын
THANK YOU SIR. GOD BLESS YOU
@VamshiKrishna-ud5qt4 жыл бұрын
Hello hitesh please explain match tied logic in tic tac toe
@mohammadyaseenshaik43253 жыл бұрын
Just awesome explanation, I’m a new subscriber for you now… 😊😊 and I’m also a technical KZbinr
@bytesizeddev3 жыл бұрын
here i am trying to build logic for Codechef May Challenge
@AbhishekJain-zu1uf5 жыл бұрын
Instead of using so many "ands" cant we just write if board[i] == board[j] == board[k] as most of the languages support this notation
@Vikram_singh_ji2 жыл бұрын
Vikram was here (at the time of learning react)!!!
@nagavedareddy58914 жыл бұрын
You're a True gem sir...!
@Dattunaik55224 жыл бұрын
Great👏👏
@Script_Sage4 жыл бұрын
came here from your angular course.
@AbhisekMaitiOfficial4 жыл бұрын
tic tac tae !!!!! tic tac tak :::: hitesh sir some times mashed up in pronunciation and i really enjoyed funny comments in middle of lecture and i never bored when watching his lecture.
@CreativeJE5 жыл бұрын
You should have taught a better way to do this it's very insufficient way
@ender29994 жыл бұрын
"insufficient"? Do you speak English? Inefficient?
@maelstrom573 жыл бұрын
@@ender2999 Imagine criticizing someone's English when you can't even open a dictionary. www.thefreedictionary.com/insufficient
@_sharmaji.dev_5 жыл бұрын
Great Video. Waiting for Saturday challenge....
@rahulkhatri51584 жыл бұрын
thanks for simply explaining the logic.
@gauravchinawale783 Жыл бұрын
We should be able to write a dynamic conditions This is all hard coded for school kids this might be fun
@mariafernandaabreufonseca96402 жыл бұрын
Really helpful. Thanks 👍
@pramaffairs4331 Жыл бұрын
life saver.... Thanks
@purnapavanchandra68235 жыл бұрын
Sir, what about Saturday coding challenges?
@vishwaraval19304 жыл бұрын
Nice you explained it amazingly I made my game like you have explianed
@creatorsconnect88075 жыл бұрын
I love ur logic pls make more such kind of stuff .
@unknownkumar37494 жыл бұрын
I have learned only one language(c++) I will make this logic in C ++ ... even if UserInterface is bad !
@shanto55145 жыл бұрын
react.js or vue? please suggest
@aj97065 жыл бұрын
React.js one of the best frameworks
@lightyagami32225 жыл бұрын
Haha i told my each and every friends to subscribe 💗
@MrDevihem Жыл бұрын
I was expecting something with logic and efficiency .... this is hardcoding the positions for winning with "if's" .
@raghuakuthota49005 жыл бұрын
Loved this video... pretty simple :) - thank you so much
@mohdnawazishalam32555 жыл бұрын
Need some more videos like this
@ashutoshanand40405 жыл бұрын
Multiple if statement may not be the good option 😑 Can we reduce time complexity?
@HiteshCodeLab5 жыл бұрын
Once you understand core concept, hundreds of ways to deal with situation.
@sujaykamatkar7885 жыл бұрын
yeah another method I use is just write 1 if statement then add condition using OR like if ( pos[0] == pos[1] == pos[2] or pos[3] == pos[4] == [5] or.... )
@abolfazldaneshvar14412 жыл бұрын
Thank very Usefull !
@AryanSingh2512.5 жыл бұрын
Please make video for 1 player tic tac toe game with intelligence.
@Luffy-um8jo5 жыл бұрын
BRo and what about losing streak
@mdfaiz55395 жыл бұрын
Your thumbnails are improving day by day
@Abdulmajeed-sy1us5 жыл бұрын
Solve complex problems sir. This is very basic
@miw8794 жыл бұрын
This is a great channel!
@nileshsinha78693 жыл бұрын
Watching this for React Course
@anuragtawaniya77464 жыл бұрын
very helpful sir
@abdush58304 жыл бұрын
Very enjoyed Sir❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
@sujaykamatkar7885 жыл бұрын
Hello Sir, I have one problem My program is running but it can't go to second player. Can you help me?
@RudraprasadMohapatraa2 ай бұрын
Ram Ram 🙏 Bhai Kya aapka ye problem solve hua aaj ko 5 saal bit chuke hein bhai ?