This is the best video I've seen so far on TH-cam for coding. You know why? Because he makes mistakes, and then corrects them, and that's the most human thing you can do. A good way to teach people coding, is by running them up on the basics, and then let them make a lot of mistakes, the more mistakes you solve, the more you will know down the road. I like to prioritize better problem solving, over memorization.
I actually made an improved version of Tic Tac Toe during highschool. Grid is 5x5; There are 3 "blocks" where you can't play, just choose randomly for this; Each player plays two per turn; The goal of the game is to complete a 5 in a row first. This elevates the game's difficulty because now you need to complete more to make a row, avoid the enemy's block as well as the natural blocks, as well as having to use actually complex strategies to trick the opponents and win. The trick is to allow yourself to gain three openings in a single move to effectively win. The opponent has two plays per turn so if you only have one opening, the game is almost guaranteed to lead to a draw since there isn't much place to play. Alike the original Tic Tac Toe where you have to provide two openings in a single move to win, this improved version made the mind-numbing experience fun and challenging. Ngl this was when I peaked in high school lol. I'm proud to say that I invented this game, or at least I'm the first to my knowledge. Try to play this version, it's incredibly fun. P.s. There is actually four different iterations of the same "map" where if you're experienced enough and the blocks are placed in a very specific position, you will 99% of the time defeat all newbies because this map makes it very easy to trick the opponent. But using this map in a match between two experienced players, the first player always wins unless they make a silly mistake. When I play this with my friends, there was an unspoken agreement between us to never play this map since it's essentially a guaranteed win to the first player. If you decide to play this version for yourself, I challenge you to find out what this map is! We found it during the first few weeks of gameplay.
When you had if(a == b == c) I was like "I had no idea you could do that in Javascript, neat.", then you were like "Oh, I can't do that". My dreams have been shattered.
Awesome! I'm in college right now for computer application development and learning c++! I've made minesweeper for an older version of python a few years ago and im planning on doing the same with c++ along with a classmate
I absolutely love that you didn’t edit out the all the mistakes, and the thought process , and what it takes to “get there” when sneaking up on a solution. For me , the take away is don’t be discouraged as a new programmer because this exercise definitely took some effort, and you’re a pro! Thanks again
I just wanna day this, I got rejected today on a job interview and was a little down , every time I’m feeling lost i watch your videos for inspiration, to know where I wanna be, I do appreciate the way you code and how much knowledge you can show in your videos on those simple challenges and that always makes me take out the dust and keep working on freelancer projects and studying more, thank you
I’m a 3d artist and a compositor. I work with a node based software. Even tho I know nothing about coding, there’s something really soothing about watching you plot your logic onto steps understandable to a computer. Also, the trick where you boil down a screen to a one dimensional array saved me a lot of trouble a couple times. Those tiny bits of super simple and elegantly put math are awesome.
You could have used numbers for X and O, for example -1 and 1, it is really easy to check if there is victory on that set of 3 by summing them: -3 = 3 X 3 = 3 O Anything else = no victory on that set Also by using 0 as empty, you can check if there is space still left on set by multiplying them, if product is 0, then there is still space. So in the end you would check if set product isn't 0 and sum is -3 or 3 for victories. But yeh might not be most intuitive approach to the problem. Just leaving this here if someone needs this tip. Edit: also turn change goes just by multiplying by -1, causing it to alternate between -1 and 1.
When I coded TTT in C# for one of my courses, I used this approach. Except I used 1 for "X" and 2 for "O". So I checked for 0 (game can continue), 1 (X won), 8 (O won), and a tie can only happen (officially) on turn 9, so as long as none of the products were 1 or 8, I could confidently declare a tie.
@Lukas If he's not going to answer, I would recommand taking a look at unity, it's a game engine that is beginner friendly and free and you can find a lot of help and resources online. It's designed for both 2d and 3d games.
When I watch your videos I actually get a Bob Ross feeling, with all your positivity and showing and explaining how you make everything Yeah, Coding Bob Ross but a bit faster paced ^^
oh yes, saw your comment, and thought that you'd might be able to answer this couple of questions: did you get stuck in the "tutorial hell"? and how did you make it to get the best out of the tutorials? thanks in advance :)
When I was about 10 years old (~1965) we went to the Museum of Science and Industry in Chicago, The Illinois Bell area had an exhibit where you could play Tic-Tac-Toe against a computer. You input your move by dialing 1 - 9 on a rotary phone dialer. The computer always got to make the first move, and, of course, could not be beaten. I was flabbergasted. How could a machine _never_ lose? I remember the display that showed how many total times it had won, lost, and tied, and that "0" lost made me almost kind of mad. I kept playing and playing, and I couldn't beat it. Never forgot that experience. Twenty years later, I owned my own computer, and the thing I wanted to do most with it was write a Tic-Tac-Toe program that could not be beaten. I finally did, in QuickBASIC. It was the first "big" programming project I'd ever attempted. It really taught me a lot, was so rewarding, and it was just a blast to finally recreate that program I'd seen as a kid. Boy, do I miss those days, back when computers were fun.
@@ryank4087 I'll have you know that anyone that learns C as their first language will have the best programming foundation. Complex behavior should come from simple rules.
You can easily detect the "mouse-tile-position" and turn the game into a real playable game like this: let x and y be the coordinates of the mouse. You just have to reduce the "resolution" of the mouse position from 0 to width, to 0 to 2 (same for the height). So let i and j be the indices of the tile matrix. We can now calculate these indices like this: i = map(x, 0, width, 0, 2); i = Math.floor(i); j = map(y, 0, height, 0, 2); j = Math.floor(i); So now you just have to update the matrix referencing these indices and then draw it to the screen. Hope I helped!
I'm 14, learning how to program in Python, and I just completed my first project which was to make Tic-Tac-Toe in Python. 6 hours later, I had 168 lines of code, and my first real coding project complete. I check this channel and you did it in 30 minutes. *stares in disbelief* Seriously though great job! I've always loved your videos and you've been an inspiration to me when it comes to programming.
I remember writing a tic tac toe bot in 9th grade. I wrote it in hypercard and it either won or tied. This is back when they taught QBasic in 7th/8th grade--which I also did.
I was coding my own version of this game prior to seeing this video, and i wondered if he too would experience the immense "bruh" of finding out that indeed, the code you wrote is fine, but if the squares are all blank they're still equal lol. kinda cool seeing how the code we wrote is similar
I love that I have coded long enough now that Prof. Shiffman is doing projects I did on my own accord. Usually it's me following along with something unfamiliar.
Fun Fact: Python actually supports the 3 equals signs! This leads to a lot of confusion, because the following mean entirely different things: a == b == c a == b && b ==c && a == c (a == b) == c a == (b == c)
I just love this video, so evocative of the programming experience. "The best laid plans of mice and computer scientists..." But your undefeatable optimism always make these a joy to watch! :)
I really like these coding challenges, as they're really satisfying to watch! I would love to see some custom physics engine in p5.js, with all the maths going through. That would be amazing 😄
Word Squares: start with an n x n grid (3 for starters). Get a list of n-letter words (3, for starters). Fill in the grid such that every row and column spells one of the n-letter words, but no words are repeated. For example: T O O U R N B E E Can you make a program that creates these automatically? Then make them with larger grids, or even rectangles?
I did my own tic tac toe game in the p5 web editor 6 months ago, where you get to choose your piece, play against ai, have a line drawn through any winning rows/columns/diagonals, and it even has a built-in restart button, so you don't need to reload the page
This started really concise and then went to math and even if I sort of got the reference points of X,Y target zero and that one unit of X,Y = "1 unit", he lost me completely, with the functions, the X-XR, Y-XR etc.
my friend and I coded an even better version of Tic Tac Toe for our one computer science class! instead of normal tic tac toe, it was a more complicated version, where each square in the grid had its own mini tic tac toe inside. we called it Extreme Tic Tac Toe, but it probably goes by many names. it’s much more complicated to code, and an interesting challenge to do so! it’s also a lot more strategic and fun to play! here’s a wikipedia article detailing the rules and more about the game! en.m.wikipedia.org/wiki/Ultimate_tic-tac-toe the rules may take a little while to understand, but i hope it is worth it since i remember it being a very fun challenge to code back in high school!
Tic tac toe is dummy easy as a game. If you learn and follow the VERY easy strategy, you can literally never lose regardless of going first or second. Whenever I play someone they always don’t get how I’m “so good” at it and that I never lose. Silly people don’t realize there’s literally a super simple strategy to learn to literally NEVER lose
And you are so good in a super tic tac toe ? Where you have a 3x3 board of tic tac toes and you need to Win 3 of tem and where you play inside is where your opponent next move need to be in the outside game.
19:34 if a=b and b=c that means a has to equal c. So you don’t need to say that. Transitive property right? EDIT: I commented this before you fixed it hehe
I don’t really program but as I was watching you type out (a == b), (b == c), (c == a) I just thought to myself that if a is equal to b and b is equal to c then it can be assumed that we already know a is equal to c and then you fixed it. Great video, now do chess or shogi :)(checkers would probably qualify as medium difficulty while chess/shogi would be considered “hard” if you were to compare the depth of each games rules)
Since each space on a Tic Tac Toe board can be in three states - Empty, X, or O, we can represent the state of a space in two bits. Since there are nine spaces on a board, we need 18 bits to represent the entire game state. An entire Tic Tac Toe board can be represented by a single, unique, integer value.
Is it just me that realized that on the checkWinner function he returns either "tie", "X" or "O" but then on the loop he checks if the result is equal to null? but it worked just fine because as its never equals to null, it logs what was returned which was one of those 3 and those are valid outputs
Какой же он экспрессивный, как много эмоций. Когда я пишу код, мне хочется убивать всех в радиусе 1-го футбольного поля (kappa) до тех пор, пока код не начнёт работать так, как я хочу. Спасибо за видео, подняло настроение. (Но вообще ничего не понятно)) )
i think i'm missing something. I'm at 3:30 and I see 2 functions, but they are not actually called anywhere. Also there's "createCanvas" that's not declared, also the variableswidth and height (gonna assume the backgroud function is part of the library?). How is this actually working? Is there another video before this one? Also, the naming of those variables... make it a little more verbose? xr would be better named xRadius for instance, don't you think?
I have a computational geometry suggestion. Can you try to generate a Voronoi diagram, maybe from a random set of points? Also, maybe visualizing the painter's algorithm on a BSP tree? Eh?
19:30 according to the 0th lax of thermodynamics, if a==b && b==c then a==c. So the third comparison is indeed redundant. Thermodynamics showing up where you wouldn't think. Kidding, nothing to do with thermodynamics.
Dude if b is equals to c, then a is equals to c because a is equals to b. You are right is simple logic, anyways when are coding against time sometimes you will silly comparison, like someFunctionthatreturntrue()==true.
This is the best video I've seen so far on TH-cam for coding. You know why? Because he makes mistakes, and then corrects them, and that's the most human thing you can do.
A good way to teach people coding, is by running them up on the basics, and then let them make a lot of mistakes, the more mistakes you solve, the more you will know down the road.
I like to prioritize better problem solving, over memorization.
Mech I agree! I'm a real beginner and I find that I learn the most when I'm trying to correct my own mistakes.
best part is, you can see he is thinking in code not in English...know his think, its just he talks/action faster then he thinks lol
"Its 3×3×3 😂😂😂"
Next level tic-tac-toe
3D tic tax toe
I actually made an improved version of Tic Tac Toe during highschool.
Grid is 5x5;
There are 3 "blocks" where you can't play, just choose randomly for this;
Each player plays two per turn;
The goal of the game is to complete a 5 in a row first.
This elevates the game's difficulty because now you need to complete more to make a row, avoid the enemy's block as well as the natural blocks, as well as having to use actually complex strategies to trick the opponents and win.
The trick is to allow yourself to gain three openings in a single move to effectively win. The opponent has two plays per turn so if you only have one opening, the game is almost guaranteed to lead to a draw since there isn't much place to play. Alike the original Tic Tac Toe where you have to provide two openings in a single move to win, this improved version made the mind-numbing experience fun and challenging.
Ngl this was when I peaked in high school lol. I'm proud to say that I invented this game, or at least I'm the first to my knowledge. Try to play this version, it's incredibly fun.
P.s. There is actually four different iterations of the same "map" where if you're experienced enough and the blocks are placed in a very specific position, you will 99% of the time defeat all newbies because this map makes it very easy to trick the opponent. But using this map in a match between two experienced players, the first player always wins unless they make a silly mistake. When I play this with my friends, there was an unspoken agreement between us to never play this map since it's essentially a guaranteed win to the first player. If you decide to play this version for yourself, I challenge you to find out what this map is! We found it during the first few weeks of gameplay.
rubiks cube tictachoe
I think I saw something like this somewhere on TH-cam, the goal is to not get 3 in a row.
Halit Başbuğ very beginners friendly
He' so happy while coding 😂😂
This is literally me all the time when I'm coding
Actually he smiles and laughs in response to pain, we're just witnessing his torment
Everyone not coding in Java or C++ is
When you had if(a == b == c) I was like "I had no idea you could do that in Javascript, neat.", then you were like "Oh, I can't do that". My dreams have been shattered.
😭
If only there was a language that could do this
oh wait, there's python.
Too bad python is trash
@@TheStrangeStorm yeah is trash javascript is more better to understand and for career to find jobs.
@@josuesuazo3635 fix your english so you'd be able to speak in order to find a job
When it comes to programming, I know only basics in C++, yet I've watched all that video with wide smile. You are amazing 😂😂
The god bless you 🌹
🇮🇶🇮🇶🇮🇶
I’ve actually been getting into C++ too! C++ gang, RISE UP
he says its beginner stuff when people like us watching like " :O wow "
I know html css js py java and arduino but I really want to learn about c++...so hail c++!
Awesome! I'm in college right now for computer application development and learning c++! I've made minesweeper for an older version of python a few years ago and im planning on doing the same with c++ along with a classmate
I absolutely love that you didn’t edit out the all the mistakes, and the thought process , and what it takes to “get there” when sneaking up on a solution. For me , the take away is don’t be discouraged as a new programmer because this exercise definitely took some effort, and you’re a pro! Thanks again
This will be short and easy. 5 minutes in "HEEEEEEEEEEELP".
I just wanna day this, I got rejected today on a job interview and was a little down , every time I’m feeling lost i watch your videos for inspiration, to know where I wanna be, I do appreciate the way you code and how much knowledge you can show in your videos on those simple challenges and that always makes me take out the dust and keep working on freelancer projects and studying more, thank you
Keep going, I believe in you!
The way you dance make my day. It's so stressful with learning 4 programming language by 3 professors. Thanks by the way tho I love it
Ikr
I’m a 3d artist and a compositor. I work with a node based software. Even tho I know nothing about coding, there’s something really soothing about watching you plot your logic onto steps understandable to a computer.
Also, the trick where you boil down a screen to a one dimensional array saved me a lot of trouble a couple times.
Those tiny bits of super simple and elegantly put math are awesome.
"this will be a simple game to make for the beginners"
5 minutes in *MATH EVERYWHERE*
Blue he means new programmers, not people that can’t do math lool
If you want to be a programmer and you think divisions and offsets are math everywhere, I got some bad news
You could have used numbers for X and O, for example -1 and 1, it is really easy to check if there is victory on that set of 3 by summing them:
-3 = 3 X
3 = 3 O
Anything else = no victory on that set
Also by using 0 as empty, you can check if there is space still left on set by multiplying them, if product is 0, then there is still space.
So in the end you would check if set product isn't 0 and sum is -3 or 3 for victories.
But yeh might not be most intuitive approach to the problem. Just leaving this here if someone needs this tip.
Edit: also turn change goes just by multiplying by -1, causing it to alternate between -1 and 1.
Oh, what a great suggestion!
When I coded TTT in C# for one of my courses, I used this approach. Except I used 1 for "X" and 2 for "O". So I checked for 0 (game can continue), 1 (X won), 8 (O won), and a tie can only happen (officially) on turn 9, so as long as none of the products were 1 or 8, I could confidently declare a tie.
this is one of the most elegant programming ideas I've ever heard of, nice!
dude
> Wants to make a beginner friendly version of Tic Tac Toe
> Makes the most Complex Tic Tac Toe imaginable
LOL yeah programming in a nutshell (from my beginners point of view)
@@hofi56 lol i made a 3d race game when i wanted a simple little game
@Lukas If he's not going to answer, I would recommand taking a look at unity, it's a game engine that is beginner friendly and free and you can find a lot of help and resources online. It's designed for both 2d and 3d games.
I absolutely LOVE how you show your mistakes because everyone makes them and it makes me feel better as a beginner :D.
the only coding channel where you can learn and smile at the same time thanks man
13:11 Daniel.exe stopped working.
That's how my bsod sounds like lmao
@The Coding Train Permission to clip this audio and use as error alert in everything ever?
Its show some ERROR like "EORRRRRR" 🤣🤣
He obviously did that for a while, and edited it out 😂
When I watch your videos I actually get a Bob Ross feeling, with all your positivity and showing and explaining how you make everything
Yeah, Coding Bob Ross but a bit faster paced ^^
I get that feeling too. Whenever I hit a snag I just come back here and get the excitement going again.
I just simply like his confidence when he started and said "the video is going to be very short"... Keep it up boii.
"This video will be very short..."
Famous last words
5:00 This needs to happen in more offices. So much more practical than staring at a problem blankly for hours.
Did TH-cam also put the video on your front page? ;)
Thank you for doing more beginner code! I love all your stuff but I get so lost, it's your voice that draws me in! :D
I learned programming through TH-cam tutorials, I am onto python but I love watching you code
oh yes, saw your comment, and thought that you'd might be able to answer this couple of questions: did you get stuck in the "tutorial hell"? and how did you make it to get the best out of the tutorials? thanks in advance :)
When I was about 10 years old (~1965) we went to the Museum of Science and Industry in Chicago, The Illinois Bell area had an exhibit where you could play Tic-Tac-Toe against a computer. You input your move by dialing 1 - 9 on a rotary phone dialer. The computer always got to make the first move, and, of course, could not be beaten. I was flabbergasted. How could a machine _never_ lose? I remember the display that showed how many total times it had won, lost, and tied, and that "0" lost made me almost kind of mad. I kept playing and playing, and I couldn't beat it. Never forgot that experience. Twenty years later, I owned my own computer, and the thing I wanted to do most with it was write a Tic-Tac-Toe program that could not be beaten. I finally did, in QuickBASIC. It was the first "big" programming project I'd ever attempted. It really taught me a lot, was so rewarding, and it was just a blast to finally recreate that program I'd seen as a kid.
Boy, do I miss those days, back when computers were fun.
You actually showed me how fun coding can be and also how fun it can be to watch someone else code! :D
yes he did
I like how he's trying to figure out codes like the rest of us... Like a normal human.
Hey! I love your videos and they are very informative, and I love how excited you are to solve these challeneges. Thank you for your videos!
One of the best coding videos I have seen. This is so real coding.
Nobody:
Computer: goes crazy because of silly error
Dan : F-ing hysterical laughter
Watch him slowly decend into insanity toward the end of video
He's not completely insane yet, he's not using plain java
@@puppergump4117 hes not programming in c yet, thats when he will fully go insane
@@ryank4087 I'll have you know that anyone that learns C as their first language will have the best programming foundation. Complex behavior should come from simple rules.
@@puppergump4117 I just mean c has lots of little quirks that would cause him to go insane
You can easily detect the "mouse-tile-position" and turn the game into a real playable game like this: let x and y be the coordinates of the mouse. You just have to reduce the "resolution" of the mouse position from 0 to width, to 0 to 2 (same for the height). So let i and j be the indices of the tile matrix. We can now calculate these indices like this:
i = map(x, 0, width, 0, 2);
i = Math.floor(i);
j = map(y, 0, height, 0, 2);
j = Math.floor(i);
So now you just have to update the matrix referencing these indices and then draw it to the screen.
Hope I helped!
Great tips!
5:13 his "1" is literally a "2" I'm dead XD
@SpencerTwiddy Nah look again it s a "1"
RIP
The scarcity of coding challenges makes them more valuable :)
Well, I hope to get back to doing them more regularly in the fall!
That's awesome to hear! ^^
LOL this is the most complicated beginner version of Tic Tac Toe and I so enjoyed watching this.
I have 0 idea what's going on here but I'm gonna freaking learn it.
I'm 14, learning how to program in Python, and I just completed my first project which was to make Tic-Tac-Toe in Python. 6 hours later, I had 168 lines of code, and my first real coding project complete. I check this channel and you did it in 30 minutes.
*stares in disbelief*
Seriously though great job! I've always loved your videos and you've been an inspiration to me when it comes to programming.
javascript is a lot better at gui stuff, but i suppose that depends on the library you used
you're doing great!! (mine is edited, find the livestrream to see how long it took with more debugging!)
this channel is a vibe
I remember writing a tic tac toe bot in 9th grade. I wrote it in hypercard and it either won or tied.
This is back when they taught QBasic in 7th/8th grade--which I also did.
"The Video Will Be Very Short" then i looked into the duration... and its 24mins.
well, i was expecting 10 mins :D
:)
:)
:)
:)
:)
He is the only programmer who laughs when he makes an error 😂😂😂
I was coding my own version of this game prior to seeing this video, and i wondered if he too would experience the immense "bruh" of finding out that indeed, the code you wrote is fine, but if the squares are all blank they're still equal lol.
kinda cool seeing how the code we wrote is similar
Hahaha he coding in a funny manner. Well done man. From a new subscriber
I love that I have coded long enough now that Prof. Shiffman is doing projects I did on my own accord. Usually it's me following along with something unfamiliar.
Wow, you are really good at Teaching and coding, it really makes the viewer feel what you feel, the code also easy to understand(in my opinion)
Fun Fact: Python actually supports the 3 equals signs! This leads to a lot of confusion, because the following mean entirely different things:
a == b == c a == b && b ==c && a == c
(a == b) == c
a == (b == c)
Dude when you create something with codes with that smile of yours it brings so much positive vibes to us. . .keep up the good work 💪
I just love this video, so evocative of the programming experience. "The best laid plans of mice and computer scientists..." But your undefeatable optimism always make these a joy to watch! :)
*Objective: Create a 3x3 tictoe*
*_Instead proceeds to create weird shapes in console XD for the first few minutes_*
this guy is the bob ross of programming
I watched you because of your sense of humour
and of course your intelligent way of coding
tic tac toe is by no means a beginner project. It is very hard to build even for advanced programmers.
Agreed!
This Dude Is Chilling! While coding
I really like these coding challenges, as they're really satisfying to watch!
I would love to see some custom physics engine in p5.js, with all the maths going through. That would be amazing 😄
I used to play a lot of those 'falling sand' games when I was younger, would be cool to see him make one of those.
I assume next up is a video on the minimax algorithm and alpha-beta pruning? Can't wait! 😃
Word Squares: start with an n x n grid (3 for starters). Get a list of n-letter words (3, for starters). Fill in the grid such that every row and column spells one of the n-letter words, but no words are repeated. For example:
T O O
U R N
B E E
Can you make a program that creates these automatically? Then make them with larger grids, or even rectangles?
I am at 7:00 , and really believe you should start using DOM more. A table with text-align = center would have been much easier
Indeed, please share a version like this!
Awesome! Been waiting for this for a while!
15:56 that sound is so satisfying 😌
I don't know much about programming, but that man is awesome
I made this in a C# WPF project. It's interesting how different languages can achieve the same outcome in such different ways.
18:55 I was like "wow I didn't know you could do that in javascript"
*This is what I was searching for*
Thanks dude :)
You made a very good job for beginners programmer in JavaScript like me! Thank you!
I did my own tic tac toe game in the p5 web editor 6 months ago, where you get to choose your piece, play against ai, have a line drawn through any winning rows/columns/diagonals, and it even has a built-in restart button, so you don't need to reload the page
Amazing, please share!
@@TheCodingTrain editor.p5js.org/PuppyProgramming/sketches/-cGEQdOhr
Hey, Daniel! You are a great teacher!
There are weird people out there who dislike this awesome video! WHY!!!!!!!
Friendly i wanna say it's tough for me as a beginner even i did understand this.
These videos make me happy.
This would've been a good 10 - 15 minutes coding challenge video.
This started really concise and then went to math and even if I sort of got the reference points of X,Y target zero and that one unit of X,Y = "1 unit", he lost me completely, with the functions, the X-XR, Y-XR etc.
1:11 I didn’t know you play tic tac toe on a cube
Omg thank you for the like man! I love you and u inspired me to code! 😛
He didn't like your comment
Vladyslav Lavrenov he did it got removed
@@yamom...5918 i thought about that :) cringe man, haha
my friend and I coded an even better version of Tic Tac Toe for our one computer science class! instead of normal tic tac toe, it was a more complicated version, where each square in the grid had its own mini tic tac toe inside. we called it Extreme Tic Tac Toe, but it probably goes by many names. it’s much more complicated to code, and an interesting challenge to do so! it’s also a lot more strategic and fun to play!
here’s a wikipedia article detailing the rules and more about the game!
en.m.wikipedia.org/wiki/Ultimate_tic-tac-toe
the rules may take a little while to understand, but i hope it is worth it since i remember it being a very fun challenge to code back in high school!
wow! Would love to see your version!
How he is coding flawlessly 🤩 amazing I know java only but still I’m learning
The first for-loop in checkWinner is checking Vertical in fact, checking horizontal should be: b[0][i] == b[1][i] == b[2][i]
Tic tac toe is dummy easy as a game. If you learn and follow the VERY easy strategy, you can literally never lose regardless of going first or second. Whenever I play someone they always don’t get how I’m “so good” at it and that I never lose. Silly people don’t realize there’s literally a super simple strategy to learn to literally NEVER lose
And you are so good in a super tic tac toe ? Where you have a 3x3 board of tic tac toes and you need to Win 3 of tem and where you play inside is where your opponent next move need to be in the outside game.
He is doing that more as like an easy example. I bet he is even going to do something like a simple neural network or something.
So I had this video open in the background around 3:30
Came back to it around 4:46
Was like "how did you even manage this, wtf"
Hahah
you can tell that he's smart just by looking at him
this guy always give me a smile on my face
19:34 if a=b and b=c that means a has to equal c. So you don’t need to say that. Transitive property right? EDIT: I commented this before you fixed it hehe
I love how you explain stuff. All this makes me enjoy all this more than I already do. Thank you !
Also, can you describe how did you setup the editor in your background with you in the foreground ?
For the first time i enjoy until the end of video. Good job. Thanks for share this video. Actually I like this tutor, very friendly.
5:00 could actually win an art award
*I'll leave it for you as a challange*
I see what you did right there
It's so weird to watch the best programmer I know having trouble with Tic Tac Toe ahahah
I don’t really program but as I was watching you type out (a == b), (b == c), (c == a) I just thought to myself that if a is equal to b and b is equal to c then it can be assumed that we already know a is equal to c and then you fixed it. Great video, now do chess or shogi :)(checkers would probably qualify as medium difficulty while chess/shogi would be considered “hard” if you were to compare the depth of each games rules)
Since each space on a Tic Tac Toe board can be in three states - Empty, X, or O, we can represent the state of a space in two bits. Since there are nine spaces on a board, we need 18 bits to represent the entire game state. An entire Tic Tac Toe board can be represented by a single, unique, integer value.
you are better than my teacher ... I've learned lot from you keep up your work.
Is it just me that realized that on the checkWinner function he returns either "tie", "X" or "O" but then on the loop he checks if the result is equal to null? but it worked just fine because as its never equals to null, it logs what was returned which was one of those 3 and those are valid outputs
Какой же он экспрессивный, как много эмоций. Когда я пишу код, мне хочется убивать всех в радиусе 1-го футбольного поля (kappa) до тех пор, пока код не начнёт работать так, как я хочу. Спасибо за видео, подняло настроение. (Но вообще ничего не понятно)) )
that "heeeelp!" he did on 4:59 is me on a daily.
if you want it to "click"
its easy check the position of the mouse and if the mouse is clicked
and just go off from that
I'm starting coding with JS, I don't understand a single thing but dang I'm enjoying it.
i think i'm missing something. I'm at 3:30 and I see 2 functions, but they are not actually called anywhere. Also there's "createCanvas" that's not declared, also the variableswidth and height (gonna assume the backgroud function is part of the library?). How is this actually working? Is there another video before this one? Also, the naming of those variables... make it a little more verbose? xr would be better named xRadius for instance, don't you think?
I have a computational geometry suggestion. Can you try to generate a Voronoi diagram, maybe from a random set of points? Also, maybe visualizing the painter's algorithm on a BSP tree? Eh?
Ai bot is pretty easy, Always start middle if possible, next one corner and next block opponent lines if needed
His definition of "BIGGNER FRIENDLY" is beyond oxford standards
I love so much of all your videos💖 good job ..don't stop please
Hi, I'm from Brazil, I love your videos ... Congratulations !!
That's got to be the most chaotic coding train ever. Loved it! Would click like twice if I could.
19:30 according to the 0th lax of thermodynamics, if a==b && b==c then a==c. So the third comparison is indeed redundant.
Thermodynamics showing up where you wouldn't think.
Kidding, nothing to do with thermodynamics.
Dude if b is equals to c, then a is equals to c because a is equals to b. You are right is simple logic, anyways when are coding against time sometimes you will silly comparison, like someFunctionthatreturntrue()==true.
Happyest coder ever
You're like a dad joke in a human form. Not meant in a bad way.
Accurate.