Awesome Javascript Number Guessing Game

Поділитися
Вставка
  • Опубліковано 26 сер 2024
  • Source Code(Google Docs): docs.google.co...
    Join My Discord Server: / discord
    Please Subscribe if you want more videos like this: / @codingwithkenny6492
    And here are the links to some of my other videos and playlists:
    Calculator Playlist
    • Javascript Calculator ...
    Talking Computer playlist:
    • I Taught My Computer H...
    Dice game playlist:
    • 2 Player Dice Rolling ...
    To-do list playlist:
    • Learn How To Build A T...

КОМЕНТАРІ • 26

  • @Explorewithlarry
    @Explorewithlarry Рік тому

    Cool video👏🏼. Can you make one that will take you to the next stage, I mean after guessing that right you should be prompted to continue to another stage of different num range let say 100-200

  • @FindingTheWorthyTV
    @FindingTheWorthyTV Рік тому +2

    is Coding with Kenny available for hire??

    • @codingwithkenny6492
      @codingwithkenny6492  Рік тому +1

      Haha appreciate it, but what exactly do you want to hire me for? 😂😂

    • @FindingTheWorthyTV
      @FindingTheWorthyTV Рік тому +1

      @@codingwithkenny6492 trying to make them have to use the paypal button before they can enter the number to see if it matches the number I put in:



      Document

      #container{
      margin:auto;
      border:7px solid Blue;
      font-size:30px;
      padding:10px;
      text-align:center;
      height:500px;
      width:600px;
      background-color:#0e2431;
      }
      p{
      color:white;
      }
      #userInput{
      width:170px;
      height:23px;

      }
      #outputText{
      color:yellow;
      }


      Guess The Guessing Jar Number
      Enter your Guess below

      Enter
      Play again


      var enterButton = document.getElementById('enterButton');
      var againButton = document.getElementById('againButton');
      var output = document.getElementById('outputText');
      var Number = (1963);
      function checkNumber(){
      var input = document.getElementById('userInput').value;
      if(input == Number){
      output.innerHTML="You've Won! "+ ", "+ " it was "+ Number;
      output.style.color="light green";
      }
      else if(input>Number && input

  • @jahongirsobirjonov8522
    @jahongirsobirjonov8522 Рік тому

    Thank you very much

  • @eduardodourado8378
    @eduardodourado8378 Рік тому +1

    Thanks for the excellent video!
    Anyone knows how could I add an iteration that would count how many guesses the user took to find the number? Thanks again

    • @codingwithkenny6492
      @codingwithkenny6492  Рік тому

      Appreciate your feedback, Eduardo! Yeah there is a way you can code up the functionality to make that work. If you have any trouble, let me know and I'll take a look at it.

  • @skrazzy
    @skrazzy 2 роки тому +3

    Cool video! I was just wondering, if you wrote a hardcoded number instead of random number, how do you hide it from the source code in dev tools? Cause then anybody could go to the dev tools and see what the correct number is (I'm new to programming). or in the dev tools if somebody went to the js file and wrote input == 7 and then they submit 7 they get the correct answer how do you prevent that from happening? Is it possible to hide that logic?

    • @codingwithkenny6492
      @codingwithkenny6492  2 роки тому +3

      Hey, thanks for reaching out!
      I'm not exactly sure yet, but I've tried doing what you were saying by building a react project and then going to the dev tools or doing CTRL + U, and it was able to hide the code from other people so I think using React might be helpful. However though, since you are new to programming, my advice for you would be to learn the fundamentals of javascript and then use what you learned to start building a TON of projects....and when I say a TON... I mean it Lol... I've spent most of this year building projects and then posting them onto my UA-cam Channel. Practice and repetition is key when it comes to learning programming(I still have a lot more to learn)

    • @codingwithkenny6492
      @codingwithkenny6492  2 роки тому +3

      But for now, since you're a beginner, you don't have to worry about anyone seeing your code since it's going to be local, meaning that only you can see it on your computer and no one else, even if you sent them the link to your project because it's not deployed yet so the link won't be valid. Hope I was able to help you. Let me know if you have any other questions or concerns!

    • @skrazzy
      @skrazzy 2 роки тому +3

      Thanks so much for the advice! I will look into react! You see right now I am learning Angular, and using angular you still see the correct number in the dev tools. And i have to say i'm not a completely new beginner, theres just random stuff i think about that i cant find the answer too hahah. but I will look into react! :) Thanks!

    • @codingwithkenny6492
      @codingwithkenny6492  2 роки тому +3

      @@skrazzy Haha that's awesome thought that you already know a little about angular. I might also consider learning that next year since I just started learning react very recently and still need to get comfortable with the core concepts and syntax! Good luck on your coding journey!

    • @skrazzy
      @skrazzy 2 роки тому +2

      @@codingwithkenny6492 Good luck to you too and your UA-cam channel! :)

  • @ymgaki7715
    @ymgaki7715 Рік тому

    Nice. How can we implement enter key from the keyboard along with the screen button? Thanks

    • @codingwithkenny6492
      @codingwithkenny6492  Рік тому

      Great idea! We can implement the logic for the enter key by creating an if statement to check the keycode of the key that is pressed and if it is equal to 13 which is the keycode for the enter key, then we can have it run the same function and it'll work the same way as the button.

  • @razarukhsar8479
    @razarukhsar8479 Рік тому

    Thankyo soo much mean alot

  • @nc6790
    @nc6790 2 роки тому +1

    How would you code so that the input is set for 7 tries only?

    • @codingwithkenny6492
      @codingwithkenny6492  2 роки тому +3

      You could create a variable called "limit" or something like that and set it to however many tries the user is allowed to have. Then after that, write a few conditional statements dictating that when the "limit" variable hits 0, alert("Game over. You lost") or something like that. I could reupload this video with your suggestion if you want to see how you could go about solving this problem:)

  • @alivelyrics5513
    @alivelyrics5513 Рік тому

    will this work if i write the code in notepad?

  • @CodingFire
    @CodingFire 3 роки тому +2

    Nnnnnoiiiice video

  • @Grane00
    @Grane00 Рік тому

    Thanks soo much