Code Tic Tac Toe in Java

Поделиться
HTML-код
  • Опубликовано: 15 июл 2023
  • 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:
    • How to set up Java in ...
    Code: github.com/ImKennyYip/tictact...
    Website: www.kennyyipcoding.com/
    Java Game Programming Projects Playlist:
    • Java Game Programming ...
    JavaScript Game Programming Projects Playlist:
    • JavaScript Game Progra...
    Subscribe for more coding tutorials 😄!

Комментарии • 31

  • @fersahahmet9597
    @fersahahmet9597 Год назад +6

    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

  • @NareshKumar-vt4sh
    @NareshKumar-vt4sh 9 месяцев назад

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

  • @aravinds6406
    @aravinds6406 7 месяцев назад +2

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

    • @olehliashyk6988
      @olehliashyk6988 7 месяцев назад

      Help me plz about tile in 12 minute on video. I do not write “tile” because I have an issue😢

  • @pland4r133
    @pland4r133 10 месяцев назад

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

  • @incarnateblizzard4874
    @incarnateblizzard4874 18 дней назад

    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

  • @user-on2rc3pv1q
    @user-on2rc3pv1q 9 месяцев назад

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

  • @philip3746
    @philip3746 2 месяца назад

    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.

  • @lizarose3095
    @lizarose3095 25 дней назад

    Thanks for the tutorial :-)

  • @Mago77_
    @Mago77_ 10 месяцев назад

    Amazing!

  • @ImHlkari
    @ImHlkari 22 дня назад

    Super underrated

  • @dannita246
    @dannita246 6 месяцев назад

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

  • @sadiulhakim7814
    @sadiulhakim7814 20 дней назад

    Thanks

  • @useruser15734
    @useruser15734 Год назад

    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?

    • @KennyYipCoding
      @KennyYipCoding  Год назад +1

      Yes, there will be more JavaScript content in the future. Currently I’m just taking some time to focus on Java so that I can expand my content to those who prefer coding in Java. But I will continue to upload JS content

    • @KennyYipCoding
      @KennyYipCoding  Год назад +1

      Unfortunately, I don’t do personal one on ones but I usually reply to comments/questions on my videos

    • @useruser15734
      @useruser15734 Год назад

      please tell me where did you learn javascript? maybe you can advise some literature on this programming language to read?! you really are the best at explaining anyone I've seen on RUclips!!!!

  • @user-yq7jr9wo2o
    @user-yq7jr9wo2o 10 месяцев назад +1

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

    • @KennyYipCoding
      @KennyYipCoding  10 месяцев назад +2

      I assume people will follow the tutorial to learn and later improve on the project. I purposely left out the replay button so that it would be something for you to figure out on your own.
      Shouldn't be too difficult since following the tutorial will teach you how to add a button, add an action listener to that button when clicked, and at the end of the video I also identified which variables you should update when resetting the game.

  • @olehliashyk6988
    @olehliashyk6988 7 месяцев назад

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

  • @GodStories1306
    @GodStories1306 11 месяцев назад

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

    • @KennyYipCoding
      @KennyYipCoding  11 месяцев назад +1

      Are you using vs code?

    • @GodStories1306
      @GodStories1306 11 месяцев назад

      @@KennyYipCoding .
      No i am not using vs code...
      Will it work on it???

    • @KennyYipCoding
      @KennyYipCoding  11 месяцев назад

      @@GodStories1306 no, it’s not necessary, but do you have a file with the main function?

  • @GodStories1306
    @GodStories1306 11 месяцев назад

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

    • @KennyYipCoding
      @KennyYipCoding  11 месяцев назад +1

      The GitHub link is in the video description

  • @peanut5280
    @peanut5280 3 месяца назад +1

    Sombody have a restart button?😢

  • @user-Red_Haired1984
    @user-Red_Haired1984 6 месяцев назад

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

    • @KennyYipCoding
      @KennyYipCoding  6 месяцев назад +1

      it is the ternary operator syntax,
      you can mentally read the syntax like so:
      currentPlayer = is (currentPlayer == playerX) ? set to playerO : else set to playerX
      this syntax is shorthand for the following:
      if (currentPlayer == playerX) {
      currentPlayer = playerO;
      } else {
      currentPlayer = playerX;
      }

    • @user-Red_Haired1984
      @user-Red_Haired1984 6 месяцев назад

      @@KennyYipCoding Thank you for the explanation!