Code Tic Tac Toe in Java

preview_player
Показать описание
How to code a Tic Tac Toe game in Java for beginners! Learn how to create a game of Tic Tac Toe in Java using the awt and swing graphics library. Throughout the tutorial, you will learn how to create a graphical user interface (GUI) to display the Tic Tac Toe game, and check win or tie conditions using a 2D array.

Setup Java with Visual Studio Code:

Java Game Programming Projects Playlist:

JavaScript Game Programming Projects Playlist:

Subscribe for more coding tutorials 😄!
Рекомендации по теме
Комментарии
Автор

Thank you for your effort Kenny, this is a very good tutorial for an average programmer. Please keep up the good work like this one. I have subcribed recently and watching all of your prev. tutorials

fersahahmet
Автор

you could also - to keep the code as much the same as possible change setWinner for anti-diagionally to this:
for (int i = 0; i<3; i++) {
setWinner(board[i][2-i]);
}

but thanks a lot for the tutorial - helped me a lot making progress with JFrame and that stuff (now I'm trying to find other ways to announce the winner :))

incarnateblizzard
Автор

playerX ? playerO : playerX;
I've never seen this kind of code before. what is that mean? sorry, im a begginer of Java.

Red_Haired
Автор

Impossible to dislike this... YOU SAVED MY LIFE!!!

ValentyneMu
Автор

Very useful tutorial. The thing I like about the video is, each line of the code you explained what it does.

aravinds
Автор

next time please add the replay button. im currently following your all game tutorial. so it will be very helpful.

FariaNourin-po
Автор

The code compiles and interprets but it doesnt give the output🥲 any solution??

tayyabahamed
Автор

I using Replit java on phone and it keeps come up with an errors! Am i doing something wrong? Is the video wrong? What is going on?! 😭

ArrowO_
Автор

Great video, very clear. I am going to try to modify your code to where the computer can play one of the players. I have seen it done in Python so I will try in Java.

philip
Автор

I am getting -
Error: Could not find or load main class TicTacToe
Caused by: TicTacToe
in my project
can you tell how to resolve this problem

MuskanRai-fp
Автор

Thank you for this amazing explanation 🎉

prajwalkamble
Автор

Why my Inteliji IDE has not see "tile"? on 12m14sec. Help me plz!!!!

olehliashyk
Автор

does this code work in ide on cellphone? like Jvdroid?

dannita
Автор

Yeahhhh 🎉 thank you kenny. Pls be continue in java projects...

NareshKumar-vtsh
Автор

keep up man uare the best keep going i'm learning so much from you

plandr
Автор

you are a king i have no idea how to code and i just made a game

Peleg-qu
Автор

In java compiler main class" Public static void main (String [] args ) not found error is getting ?.
Solution plz🙏

GodStories
Автор

very cool explanation! Will there be more JavaScript content? will there be any JavaScript tutorials or maybe you will understand the algorithms and Data Structures in JavaScript? And yet, can I contact you personally, write to you?

useruser
Автор

Why I can't see code on your site????

GodStories