Tic Tac Toe Game using HTML CSS & JavaScript

Поделиться
HTML-код
  • Опубликовано: 13 июн 2024
  • Tic Tac Toe Game using HTML CSS & JavaScript
    Short Definition:
    Tic tac toe is a multiplayer game and the players of this game have to position their marks(sign) so that they can construct a continuous line of three cells or boxes vertically, horizontally, or diagonally. An opponent can stop a win by blocking the end of the opponent's line.
    Download Codes From Here - www.codingnepalweb.com/tic-ta...
    Second Channel - bit.ly/3aHNkru
    Facebook - / coding.np
    Instagram - / coding.np
    Timestamps:
    0:00 Tic Tac Toe Intro
    1:53 Creating selection box (HTML & CSS)
    5:10 Creating playboard section (HTML & CSS)
    10:22 Creating result box (HTML & CSS)
    13:18 JavaScript code start
    14:45 Hiding selection box and showing playboard section on Player (X) button click
    16:44 Hiding selection box and showing playboard section on Player (O) button click
    18:36 Function for showing icon or sign on user click
    23:18 Function for showing icon or sign on bot select
    32:24 Function for matching winning combinations & selecting a winner
    39:16 Showing result box with winner sign (X or O)
    42:07 Match drawn function and showing result box with match drawn text
    44:08 Realoding current page on the replay button click
    34:32 In line no. 91 of JavaScript file, I did a mistake while putting winning combinations number. I've written 6,7,8,playerSign but it's actually 7,8,9,playerSign. So if you're following the codes then just correct it.
    Music Credit:
    Track: Jordan Schor & Harley Bird - Home [NCS Release]
    Music provided by NoCopyrightSounds.
    ➤ Watch: • Jordan Schor & Harley ...
    Track: Jimmy Hardwind - Want Me (feat. Mike Archangelo)
    ➤ Watch: • Jimmy Hardwind - Want ...
    Track: Lost Sky - Vision [NCS Release]
    Music provided by NoCopyrightSounds.
    ➤ Watch: • Lost Sky - Vision | Du...
    Levianth & Axol - Remember (feat. The Tech Thieves) [NCS Release]
    Music provided by NoCopyrightSounds.
    ➤ Watch: • Levianth & Axol - Reme...

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

  • @CodingNepal
    @CodingNepal  3 года назад +28

    Remember to Like & Subscribe 💙

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

      what is the font website on the css code part?

  • @WiLDeveD
    @WiLDeveD Год назад +2

    in Beginner level , CodingNepal's Projects are best in RUclips in details and explanation. Thanks buddy and God Bless You...

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

    I watching and also coding this game and i finished half of the project. This video is soo awesome 😊 and informative!

  • @school_boy14
    @school_boy14 3 года назад +6

    Wish u a happy happy new year 2021 Coding 🇳🇵Nepal & thank u for your amazing videos , wish u get million of subscribers youtube award🏆 soon this year 🥳✨🌟

    • @CodingNepal
      @CodingNepal  3 года назад

      Thank you and happy new year too 💙

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

    thank you fir this project! I learned a lot from this

  • @NarkomanDenchik
    @NarkomanDenchik 3 года назад +5

    I have done every step. But X and O doesn't show on the table(( Can't understand why(( Can you help me?

  • @romuloalves9349
    @romuloalves9349 3 года назад +6

    Ótimo vídeo parabéns 👏.

  • @parthgupta4850
    @parthgupta4850 3 года назад +3

    Going to make this now! you re great brother! thanku very much 👌👍

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

    Thanks a lot for helping beginners

  • @divyapatel6146
    @divyapatel6146 2 года назад +2

    You are amazing. Liked and subscribed.

  • @sankaranarayanan7847
    @sankaranarayanan7847 3 года назад +24

    Bro, can you do voiceover for js project..

    • @CodingNepal
      @CodingNepal  3 года назад +22

      Yes bro but with voice over video length will be more than double and my English also not good. I'll try to add my voice in my upcoming videos... Stay tuned 💙

    • @bhuvneshkumar7419
      @bhuvneshkumar7419 3 года назад +1

      @Atul Kumar😂

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

      @@CodingNepal bro Hindi mai bta diya kro

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

      ​@@CodingNepal bro whatever your coding skills are next level

  • @abhiramvegesna7690
    @abhiramvegesna7690 3 года назад

    This helped me a lot thank you soo much you are like the best coder, you should work for google

  • @programmingweb5250
    @programmingweb5250 3 года назад +2

    Nice and cool sir....games coding in JS is always cool

  • @seveto3911
    @seveto3911 3 года назад

    Amazing Job :)

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

    Thanks for amazing video

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

    I have a question What if we have to add difficulty in this project how can we do this ?

  • @bea_11_anubhagajargaonkar76
    @bea_11_anubhagajargaonkar76 3 года назад +3

    Superb....Can it be used for final year project?
    Also suggest project for final year and yes please start making video on final year project it will be very helpful

  • @CreativeTutorialsWeb
    @CreativeTutorialsWeb 3 года назад +5

    Amazing🌟😁 New level coding

  • @lupi5764
    @lupi5764 3 года назад +2

    Thanks sir for ur amazing tutorial.

  • @rezvanibeastx3452
    @rezvanibeastx3452 3 года назад +3

    Nice tic toe game.

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

    It would be amazing if there would be option to choose to wheather to play against biginner level, intermediate level or hard level. But i hope in the future!

  • @quangtran7954
    @quangtran7954 2 года назад

    I don't understand the code: playerSign = 'X'; in the bot function (runBot). How can it fix id override? Can someone explain it to me?

  • @AnimeThings_
    @AnimeThings_ 3 года назад +2

    Awesome bro always

  • @OrgilsYTChannel
    @OrgilsYTChannel 3 года назад +3

    Nice Thank you

  • @BieAnimation
    @BieAnimation 2 года назад +2

    Awesome !

  • @Noobgamer-qe4gv
    @Noobgamer-qe4gv 2 года назад +2

    Bro u r great bro🔥🔥🔥👍👍❤️❤️😎😎😀

  • @ayabc4320
    @ayabc4320 3 года назад +3

    Amazing ❤️🔥💙

  • @baazigar5
    @baazigar5 10 месяцев назад +1

    this project is lil bit difficult and confusing for beginners like me :/
    however, your skills are amazing!

  • @kavitadhiman4159
    @kavitadhiman4159 2 года назад

    Epic bro thx yrr

  • @osamaking244
    @osamaking244 2 года назад +2

    In 21:24 line num 32 u used a symbol before PlayerOIcon, which symbol u used can u explain please??

    • @CodingNepal
      @CodingNepal  2 года назад

      It's a $ sign.. You can assign variable value like this `${var_name}`. It's called template strings.

  • @cancel7128
    @cancel7128 2 года назад +1

    Thanks

  • @luciferthefallenangel2235
    @luciferthefallenangel2235 3 года назад +2

    Great 👍

  • @tacva2607
    @tacva2607 3 года назад +2

    very great video

  • @Jef.6.5.3
    @Jef.6.5.3 3 года назад +5

    can you make me a video tutorial on how to create a "modal" using just the jquery plugin: not (jquery ui or something else).
    #I_ask_for_help.

    • @CodingNepal
      @CodingNepal  3 года назад

      Here are some videos related it
      ruclips.net/video/W4fQnBlwoWA/видео.html
      ruclips.net/video/OkJYtw1mPeU/видео.html
      ruclips.net/video/yQ5UbCJYYjs/видео.html

  • @burgasdragonheirsilentgods
    @burgasdragonheirsilentgods 3 года назад +3

    Great Video !!! I have some videos with HTML too

  • @mustaqali960
    @mustaqali960 3 года назад +3

    Ek no bro...

  • @balladofthecats.
    @balladofthecats. 2 года назад +2

    Hi there, it happens to me that at minute 15:15, when clicking, the box does not disappear. I look and review and can't find why. Also I get that a "," is expected between window and load, in js. and "Uncaught SyntaxError: Missing initializer in const declaration" as well
    Someone happened like that? And / or can you help me? Thank you
    By the way, good video and work!

  • @__su_man
    @__su_man 3 года назад +2

    now this is awesome, 👍

  • @enginnerclub120
    @enginnerclub120 3 года назад +2

    Full support to you

  • @enginnerclub120
    @enginnerclub120 3 года назад +2

    You are very Awesome

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

    I don't understand this. Line 9 to 12 is giving me a bug. How do I fix this?? I've been figuring this out for three days now.

  • @kossikosam4181
    @kossikosam4181 3 года назад +2

    I really like your tutorials if I can afford I would like to be more in contact with you

  • @sapmation
    @sapmation 2 года назад

    My replay "button" is coming at the same line as the "won text". Please help.

  • @thomasbosshard5853
    @thomasbosshard5853 2 года назад +2

    hey, why did you write the sript link in the div area below instead the head element?

    • @CodingNepal
      @CodingNepal  2 года назад

      If you put script tag inside head then the codes of it run before the html codes/contents loaded and you get errors in javascript codes. So I've put the script tag before the end of body.

    • @thomasbosshard5853
      @thomasbosshard5853 2 года назад

      @@CodingNepal ahh oke. thx for the quick answer :)

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 3 года назад +6

    Bro instead bg music u can use your voiceover for beginners those who want to understanding js coding

    • @CodingNepal
      @CodingNepal  3 года назад

      Ok bro.. I'll try

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

      @@CodingNepal u make app game, now where u sell it? app store? google play? where??

  • @asiqmanchannel24
    @asiqmanchannel24 3 года назад +1

    best site

  • @rahatsaeed334
    @rahatsaeed334 8 месяцев назад

    where you have a kit

  • @proveyourself24
    @proveyourself24 3 года назад +1

    Great

  • @AllenThomasVarghese
    @AllenThomasVarghese 3 года назад +1

    Nice CSS skills!

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

    when I click on the "Player O" button I don't get the box with the O

  • @wenqiangzhan1547
    @wenqiangzhan1547 2 года назад

    oooooo.so good

  • @kossikosam4181
    @kossikosam4181 3 года назад

    Very fun
    sure

  • @abdazizabdkadir7285
    @abdazizabdkadir7285 3 года назад

    can we change the icon?

  • @manshafsiddiqui8818
    @manshafsiddiqui8818 2 года назад +1

    Bro 1 error h Jb me player O choose kr ra hn tow mere box select krne k bd bot() X select krta h lakin uske bd bh upper x's turn araha h.

    • @CodingNepal
      @CodingNepal  2 года назад

      Thanks, bro for informing me about this mistake. I have fixed it and you can download the updated code files from the same link that you used to download before.

  • @Letsdream16
    @Letsdream16 2 года назад +3

    Awesome 😍..sir can I get source code and report of this game??for project purpose

    • @CodingNepal
      @CodingNepal  2 года назад +3

      Source codes and detail explanation of this project is here www.codingnepalweb.com/tic-tac-toe-game-javascript/

    • @Letsdream16
      @Letsdream16 2 года назад +1

      @@CodingNepal thank you so much sir 😍

  • @hellerop1805
    @hellerop1805 3 года назад +1

    Nic

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

    can this be done on Firebase?

  • @Jai-ww8do
    @Jai-ww8do 3 года назад +2

    Bro super tell how to become like you how to learn HTML css javascript php bootstrap like pro

    • @CodingNepal
      @CodingNepal  3 года назад +1

      It's all about learning bro... So keep learning 💙

    • @Jai-ww8do
      @Jai-ww8do 3 года назад +2

      Tq bro it's your real name prakash

    • @CodingNepal
      @CodingNepal  3 года назад +1

      Yes bro

    • @Jai-ww8do
      @Jai-ww8do 3 года назад

      You from tamilnadu India

  • @surayaaziz3665
    @surayaaziz3665 3 года назад +1

    Can i change another icon like fas fa-bus?

  • @sapmation
    @sapmation 2 года назад

    15:17 I did exactly the same but it is not happening.
    //selecting all required elements
    const selectBox = document.querySelector(".select-box");
    selectXBtn = selectBox.querySelector(".player-x");
    selectOBtn = selectBox.querySelector(".player-o");
    window.onload=()=>{ //once window loaded
    selectXBtn.oncick= ()=>{
    selectBox.classList.add("hide"); //hide the select box on player x button clicked
    }
    }

  • @AnimeThings_
    @AnimeThings_ 3 года назад +1

    Is it mobile friendly??

  • @mavenxplays9957
    @mavenxplays9957 3 года назад +1

    oh my god..😲😲

  • @dev_jun
    @dev_jun 3 года назад +2

    first one

    • @CodingNepal
      @CodingNepal  3 года назад

      Great man 😄

    • @dev_jun
      @dev_jun 3 года назад

      @@CodingNepal Bro i wanna master my basics in javascript in one month how?please reply

  • @willyfernandes3367
    @willyfernandes3367 3 года назад +1

    Make a video teaching how to upload videos

    • @CodingNepal
      @CodingNepal  3 года назад +1

      Means?

    • @willyfernandes3367
      @willyfernandes3367 3 года назад

      Upload videos to save in the database or you only make animations with HTML css and js

    • @hellerop1805
      @hellerop1805 3 года назад

      Video is not uploaded in db bro only video name saved in db but uploaded to server directory

  • @shouryarexgaming855
    @shouryarexgaming855 2 года назад

    Please I want tic tac toe drive PDF please

  • @surayaaziz3665
    @surayaaziz3665 3 года назад +1

    Can i reply x and o to images?

    • @CodingNepal
      @CodingNepal  3 года назад

      You mean replace..? Yes you can!

    • @surayaaziz3665
      @surayaaziz3665 3 года назад

      @@CodingNepal yup replace. Sorry my mistake. Typos there hahaha thank u so much. I already replaced it

  • @TIGRANNagdalyan
    @TIGRANNagdalyan День назад

    Я скопировал код, и он не работает код на джаваскрипт😢

  • @Dailythingsx
    @Dailythingsx 3 года назад

    Bro are you teaching or just practicing yourself.

  • @nandinijain8531
    @nandinijain8531 2 года назад

    What is the problem u face while creating this game

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

    hi, prepare 2048 game

  • @HemanthKumar-up5iv
    @HemanthKumar-up5iv 3 года назад +1

    I m getting errors bro help me

  • @Mkumarei
    @Mkumarei 3 года назад +1

    Afnu voice Hala na bro ...

  • @hakeemmohammed2919
    @hakeemmohammed2919 2 года назад +1

    can you give us source code file 3>

    • @CodingNepal
      @CodingNepal  2 года назад

      Source files link is in the video description

  • @HuziFilms
    @HuziFilms 3 года назад +2

    What are you are you Mosnter

  • @justiceasinobi5341
    @justiceasinobi5341 3 года назад +1

    can u slow the video pls nxt tym

  • @iqbolasobirova6770
    @iqbolasobirova6770 2 года назад +1

    I have problem

  • @ujenbasi9495
    @ujenbasi9495 3 года назад +1

    i only understood half js. 😅😅😅😅

    • @CodingNepal
      @CodingNepal  3 года назад +1

      Just download source files from the given download link.. I've explained each javascript line with comments so you'll easily understand the codes.

  • @koulibalyfamily1568
    @koulibalyfamily1568 2 года назад

    Hello bro do you have the code for 3 to 5 player on the 4x4 board if yes can you send it to me please I already sent to a massege on your Gmail account
    Thanks in advance bro