With no knowledge of programming what so ever, your series on tic-tac-toe is amazing. The way you just seem to reel the code out at will is impressive. I have a month off soon due to a planned amputation and your series is now going to give me something to 'have a go at' whilst I'm healing. I'm starting understand Excel more and have just started to experiment in VBA and have purchased a VBA for dummies book. Impressed...
This tutorial might have been uploaded 6 years ago but it's still very helpful. I had to create a similar program for my Classes and this has put me in the right direction. So thank you!
This is perfect for someone like me who has already taken courses in C++ and read up on C#. I don't need to start all over from the beginning, which is where most tutors start. I am following this just fine.
Thank you so much for doing a PRACTICAL demonstration. I was getting so sick of learning the dictionary definitions of different programming elements. This is a great change of pace. I will definitely check out the rest of your channel.
I am extremely grateful to you for this tutorial. The code is easy to understand. Your explanation is easy to understand as well. You have made the code nice and clean. I have a game to code in my finals tomorrow which is similar to tic tac toe so this tutorial helped me a ton! Thanks.
A continuation of this video is available at: (Part 2) Visual Studio Winform Tic Tac Toe Tutorial Example (C#). It adds two features, (1) to keep track of the number of times X, O wins and the number of draws, and (2) to show who's turn it is.
***** the data type bool is relative to the language you are using, not what version of C#. You sure you didn't create a VB.net project vice a C#.net project?
***** Yah, I think MS breaks out different flavors of studio express. There's a web version and a Windows Desktop version. www.visualstudio.com/downloads/download-visual-studio-vs
***** I don't use VS express, I use a full version of Visual Studio. All of my videos so far are winform tutorials with the ASP.net mail app being the only exception. If you want to try and tackle most of these videos, get the Express version for Windows Desktop.
Nice tutorial series on C#. I am using the Tic Tac Toe project for a high school programming class. The pace and difficulty works well for new programmers. How about some new projects in the same line of work. Games - connect 4, checkers, card games such as war or memory?
Very nice job at explaining what is going on. I really like this tutorial helped me to better understand how C# works and also how to design my own gui
Instead of changing the button text to "", it is a better practice to make use of `.Empty`. It makes it a little bit easier for someone else to read the code.
you can do it without he whole DisableButtons function. just put your buttons in a table layout and disable it at the there_is_a_winner function :) correct me if i'm wrong
Starting a project to build a kakuro game (c# winform) and needed a little bit of inspiration for creating the ui do watching this tutorial for some hints Don't know if there's even kakuro tutorials out there and don't want to look because I only want hints and ideas, not specific copy/paste code. So hopefully this will help. Edit: great! this gives me ideas for how to tackle several different methods, and a template for how to initialize the ui. I wasn't sure what the best way to allow the user to interact with the ui: buttons will probably work fine enough.
hi Chris, i'm watching your Tutorial. I write to you because i have little question. After win X or O, we can still push the buttons, i try disable this, because i can't :/ Little help? ;)
wow, well I thought this was going to be easy. Just started a course at college. C# I kind of got stuck but completed it. Anyway thanks I probably learned some more code then i would on a easier tic tac toe tutorial.
At 26:00 when you are writting to disable the buttons, why do you write "try" and "catch"? i would need a noob explanation cuz im really new at this. Thanks.
Hi. I am trying to convert the disableButtons method to VB. The part the loop "Foreach (control c in controls)" section at around 24:45 on the timeline is what I am trying to conquer . Can anyone help with that? (I got around it by disabling each button separately, but of course the foreach loop method would be better). Thanks.
You've just saved my life! You have the perfect voice for this kind of videos, so firm... plus the ability you have to teach. You're great, thanks. Do you have other tutorials for begginers?
Olá! Tentei escrever seu código, acompanhando este tutorial, e ao escrever a rotina de um novo jogo, no meu caso, só apaga os botões A2 e A3. por que isso acontece? "Helo! I tried to write your code, following this tutorial, and when writing the routine for a new game, in my case, just delete the A2 and A3 buttons. Why does it happen?"
thanks smith I have question . Will it affect the game program if i am working on Visual Studio 2015. In my everything seems to be except DisableButton . Please help me out on this one . P.S. i am new to programming
Wow awesome, thank you for this video. i am building a "5x5x4" tic tac toe, the problem i am having is this:My buttons are not being disabled even after either "x" or "o" wins. i add disable button code exactly as you showed, still no luck
It's been 25+ years since I've programmed ZX BASIC (spaghetti coding) and I'm totally new to OOP. Most other tutorials have come from first steps, describing things like variables and arrays which I'm already familiar with. This is just what I need, a top down approach describing a program from start to finish. There are some things I don't understand but I can understand the majority of what you say. I've still to look at more of your work Chris but this has been really useful for me. One thing if you haven't already put it on RUclips. Could you describe the design stage? You dive straight into coding but you had to come up with the idea for Tic Tac Toe somewhere. I know it's a simplified game but for more complicated projects then you must write things down. How would you go about it?
Thank you so much Chris. You helped me to understand tic-tac-toe game very easily. I followed your tutorials, but I have weird mistake. In the checkForWinner method, messageBox pop-up 10 times... Where am I need to check for this mistake? Thank you and I'll see you at next tutorial ! :)
your video is awesome and useful it is a good lesson for beginners like me ...... Can I ask you a question, please I started learning C# by creating Console apps but I spent about 1.5 month till now using this way ...... is moving to another method like this good for me now ? or not ? I can declare functions and reuse them ... please I am waiting for your answer
I would recommend using an enum for button states and saving the states in an array. It would make checking for a winner much cleaner. Something like this for the first horizontal row: if (S[0] == S[1] && S[1] == S[2] && S[0] != STATES.NONE) return S[0];
If somehow we have a winner in 9th turn, the "Draw" message box still shows. I just add a return there. Thank you for this tutorial, it helps me a lot.
you can just add "if (!is_there_a_winner)" (not sure if its the right variable, i named my just winner and i didnt watch the vid again after the fix) one line above the message box which says its a draw
8:45 Adding ; caused an error in VB 2015. Also, I am not seeing a lot of that code you have in your box. Not sure why. Also, your file name is .cs, mine is .vb. Not sure if any of that is a problem.
can you post the code when i write the code for check i click one button the winner show up and i did it just like in the video but the problem isn't fix
Hello i actually made this and the disable buttons function isn't working in the project I made even though the code is exactly the same as yours. I have a project coming up this Monday, can you please help out??? It would mean a lott
Hi...I am trying to convert this to VB. How can I do the casting part into a button? (The usual way is to code each button separately, but this idea is nice). Does anyone know how to convert this casting part to VB?
make a turial example for C#, code the game Tic tac toe and apply the following modification. -Instead of a X or O, use sprites. Have 2 different sprites to represent each sides (Player A and Player B). -You must have 3 instances of each sprite for each player to use.
Hello. I am having problems when you go to click a new game. When I do that, my form will not allow me to start a new game. When I click on new game, all my boxes are grayed out and it won't let me do anything. Not sure what I'm doing wrong. Can you help me? Thank you!
I’m in a c# class right now, and I’m geeking over the first 10 minutes of the video. It makes everything so much more practical and aesthetic.
With no knowledge of programming what so ever, your series on tic-tac-toe is amazing. The way you just seem to reel the code out at will is impressive. I have a month off soon due to a planned amputation and your series is now going to give me something to 'have a go at' whilst I'm healing. I'm starting understand Excel more and have just started to experiment in VBA and have purchased a VBA for dummies book. Impressed...
2020 and this tutorial still rocks. Thanks man.. worked like a charm!
i have tried so many tutorials on tic tac toe and yourse is the only one that worked. Thanks man.
This tutorial might have been uploaded 6 years ago but it's still very helpful. I had to create a similar program for my Classes and this has put me in the right direction.
So thank you!
This is perfect for someone like me who has already taken courses in C++ and read up on C#. I don't need to start all over from the beginning, which is where most tutors start. I am following this just fine.
Thank you so much for doing a PRACTICAL demonstration. I was getting so sick of learning the dictionary definitions of different programming elements. This is a great change of pace. I will definitely check out the rest of your channel.
Thank you! This was one of the best guides I have seen in a while - keep up the good work and looking forward for new content
Solving exception occurred when we want to disable buttons:
private void disableButtons()
{
foreach(Control c in Controls)
{
if(c.GetType() == typeof(Button))
{
Button b = (Button)c;
b.Enabled = false;
}
}
}
Great! thanks! :)
thanks
Great help!
Thanks!
thank you. this help a lot.
I am extremely grateful to you for this tutorial. The code is easy to understand. Your explanation is easy to understand as well. You have made the code nice and clean. I have a game to code in my finals tomorrow which is similar to tic tac toe so this tutorial helped me a ton!
Thanks.
I LOVE YOU MAN, YOU REALLY SAVED ME, Not because I copyed your code, I truly understanded it! THANKS!
Keep doing video-examples like this one, please!
Why people dislike this kind of very educational videos...
Wow the code is very clear and elegant. I have watched this with pleasure
A continuation of this video is available at: (Part 2) Visual Studio Winform Tic Tac Toe Tutorial Example (C#). It adds two features, (1) to keep track of the number of times X, O wins and the number of draws, and (2) to show who's turn it is.
***** the data type bool is relative to the language you are using, not what version of C#. You sure you didn't create a VB.net project vice a C#.net project?
*****
Yah, I think MS breaks out different flavors of studio express. There's a web version and a Windows Desktop version. www.visualstudio.com/downloads/download-visual-studio-vs
*****
I don't use VS express, I use a full version of Visual Studio. All of my videos so far are winform tutorials with the ASP.net mail app being the only exception. If you want to try and tackle most of these videos, get the Express version for Windows Desktop.
***** Hey..not sure. I would google it to see the lowest price you can find. If you are a student, you can probably find it pretty cheap.
Chris Merritt If you are a student you can get it for free via Dreamspark
Great tutorial.. thanks a million... just started learning C# and this finally gave me a sense of getting somewhere with a practical exercise!
Chris you can select all the buttons before typing button_click
Awesome tutorial! Helped me with my school project!
Nice tutorial series on C#. I am using the Tic Tac Toe project for a high school programming class. The pace and difficulty works well for new programmers. How about some new projects in the same line of work. Games - connect 4, checkers, card games such as war or memory?
2 year old video and it still kicks ass! Thank you for this, you are awesome :)
4 year old comment and it still kicks ass! Thank you for this, you are awesome :)
You saved my end of the year project, although im not doing tic tac toe, i never learned how to program games or different thing. You enlightened me!!
Very nice job at explaining what is going on. I really like this tutorial helped me to better understand how C# works and also how to design my own gui
Instead of changing the button text to "", it is a better practice to make use of `.Empty`. It makes it a little bit easier for someone else to read the code.
you can do it without he whole DisableButtons function. just put your buttons in a table layout and disable it at the there_is_a_winner function :)
correct me if i'm wrong
can u explain the Button b = (button)sender; part again? i did not understood it, what exactly does it do?
Amazing Tutorial to follow!
what I would recommend in 2013 users is take the button text clear and put it before the button text enable as otherwise it flashs
Best tutorial I have ever seen!!!
This was very helpful, thank you
Thanks, great demo for new novice in c#
Thank you so much Chris Merritt. It helped me a lot in making the same.
Starting a project to build a kakuro game (c# winform) and needed a little bit of inspiration for creating the ui do watching this tutorial for some hints
Don't know if there's even kakuro tutorials out there and don't want to look because I only want hints and ideas, not specific copy/paste code.
So hopefully this will help.
Edit: great! this gives me ideas for how to tackle several different methods, and a template for how to initialize the ui. I wasn't sure what the best way to allow the user to interact with the ui: buttons will probably work fine enough.
hi Chris, i'm watching your Tutorial. I write to you because i have little question.
After win X or O, we can still push the buttons, i try disable this, because i can't :/
Little help? ;)
ARE YOU LEGIT DUMB HE FIXED THAT IN THE VIDEO
wdym by "i write to you" ?
thanks a bundle, helped alot in my assignment
you're a great teacher!! god bless you
Thanks Man!! You really helped me out learning C# and Visual Studio!
wow, well I thought this was going to be easy. Just started a course at college. C# I kind of got stuck but completed it. Anyway thanks I probably learned some more code then i would on a easier tic tac toe tutorial.
lmao you still in college my dude?
Super helpful, enjoyed creating this - thanks!
Oh, my english isn't well, but I have understood almost everything that you explained. Thx
Great Tutorial Chris! Keep it up!
Thanks Bro.
Easy To Understand.
it was easy to understand very well thank you
Chris Merritt can i use text box rather than buttons..
Thank you very much!!!!Excellent job.
Excellent video ! thank you !!!
I really enjoyed creating tic tac toe :)
At 26:00 when you are writting to disable the buttons, why do you write "try" and "catch"?
i would need a noob explanation cuz im really new at this.
Thanks.
Hi. I am trying to convert the disableButtons method to VB. The part the loop "Foreach (control c in controls)" section at around 24:45 on the timeline is what I am trying to conquer . Can anyone help with that? (I got around it by disabling each button separately, but of course the foreach loop method would be better). Thanks.
thank you for this tutuorial. i was very helpful.
you explain it just like someone that has never programmed before understand it
go so on
Thanks.. you make it so simple
Very good video! thank you very much!
cool tutorial!
sir please make video on on-screen keyboard
great video, lot of fun to do, thanks:)
thank you sir, I really get the logic and made it using picture box.
Is there a way to load previous game outcomes? I mean showing each players exact move for a winning game without a database?
You've just saved my life! You have the perfect voice for this kind of videos, so firm... plus the ability you have to teach. You're great, thanks. Do you have other tutorials for begginers?
Lol
Olá!
Tentei escrever seu código, acompanhando este tutorial, e ao escrever a rotina de um novo jogo, no meu caso, só apaga os botões A2 e A3.
por que isso acontece?
"Helo!
I tried to write your code, following this tutorial, and when writing the routine for a new game, in my case, just delete the A2 and A3 buttons.
Why does it happen?"
Amazing thank you so much for the tutorial
fantastic video !!!
Great work. Thanks for tutorial!!
Chris could you please reply to this, is there another way to do this without using the button b = (button)sender; ?
How would your clear the board if you didn't have new game?
Thanks for this!
thanks smith
I have question . Will it affect the game program if i am working on Visual Studio 2015.
In my everything seems to be except DisableButton . Please help me out on this one .
P.S. i am new to programming
Nice.......very simple.......Thank you............!!
This was very helpful
Thank you so much! It helped me a lot.
Wow awesome, thank you for this video. i am building a "5x5x4" tic tac toe, the problem i am having is this:My buttons are not being disabled even after either "x" or "o" wins. i add disable button code exactly as you showed, still no luck
Can i ask why my new game n disable button will malfunction at the last ? They all work well before
It's been 25+ years since I've programmed ZX BASIC (spaghetti coding) and I'm totally new to OOP. Most other tutorials have come from first steps, describing things like variables and arrays which I'm already familiar with.
This is just what I need, a top down approach describing a program from start to finish. There are some things I don't understand but I can understand the majority of what you say. I've still to look at more of your work Chris but this has been really useful for me.
One thing if you haven't already put it on RUclips. Could you describe the design stage? You dive straight into coding but you had to come up with the idea for Tic Tac Toe somewhere. I know it's a simplified game but for more complicated projects then you must write things down. How would you go about it?
great tutorial!
Is there any algorithm being used in this??? PLEASE TELL
sir please make video on MP3 player in C#
Thank you so much Chris. You helped me to understand tic-tac-toe game very easily.
I followed your tutorials, but I have weird mistake. In the checkForWinner method, messageBox pop-up 10 times... Where am I need to check for this mistake? Thank you and I'll see you at next tutorial ! :)
Thanks for the video! I was overwhelmed at first, because it looked more complex than Python. However, all went well! Again, thanks!
what is bool?
Very good tutorial :)
your video is awesome and useful it is a good lesson for beginners like me ...... Can I ask you a question, please I started learning C# by creating Console apps but I spent about 1.5 month till now using this way ...... is moving to another method like this good for me now ? or not ? I can declare functions and reuse them ... please I am waiting for your answer
I would recommend using an enum for button states and saving the states in an array. It would make checking for a winner much cleaner. Something like this for the first horizontal row:
if (S[0] == S[1] && S[1] == S[2] && S[0] != STATES.NONE) return S[0];
If somehow we have a winner in 9th turn, the "Draw" message box still shows. I just add a return there.
Thank you for this tutorial, it helps me a lot.
you can just add "if (!is_there_a_winner)" (not sure if its the right variable, i named my just winner and i didnt watch the vid again after the fix) one line above the message box which says its a draw
Awesome, thanks for the video
I have to write code for the game Connect Four. Do you have any tutorials on that? If not, can the logic for Tic-Tac-Toe be transferred?
Hello I have a question, I have everything working but my messagebox won't show up when I have a winner, what may be the issue?
How can you replace the X and O with images with png, or jpg.
8:45 Adding ; caused an error in VB 2015. Also, I am not seeing a lot of that code you have in your box. Not sure why. Also, your file name is .cs, mine is .vb. Not sure if any of that is a problem.
Excellent thank you a lot. Very well explained
can you post the code when i write the code for check i click one button the winner show up and i did it just like in the video but the problem isn't fix
What a beautiful old times the first game I ever created with visual basic
How did you want to do the result in a forech part, like you started and then left it at minute 16?
Any system where DRY is going to be a factor in your code?
Very neat tutorial~
Hello i actually made this and the disable buttons function isn't working in the project I made even though the code is exactly the same as yours. I have a project coming up this Monday, can you please help out??? It would mean a lott
Thank you a lot you made my dayy
Thank you very much for your helpful video)
How can i disable just the X && O Buttons and let the others actions in function?
my code doesnt work but ive got no errors, any suggestions pal? the disablebuttons section i have the exact same code but it does not disable them
Hi...I am trying to convert this to VB. How can I do the casting part into a button? (The usual way is to code each button separately, but this idea is nice). Does anyone know how to convert this casting part to VB?
hey I got it from another video. DirectCast(sender,button).text = "X"
thanks for these videos.
make a turial example for C#, code the game Tic tac toe and apply the following modification.
-Instead of a X or O, use sprites. Have 2 different sprites to represent each sides (Player A and Player B).
-You must have 3 instances of each sprite for each player to use.
Thanks,its helped me a lot.........
Hello. I am having problems when you go to click a new game. When I do that, my form will not allow me to start a new game. When I click on new game, all my boxes are grayed out and it won't let me do anything. Not sure what I'm doing wrong. Can you help me? Thank you!
Very impressive thank you alot 😍