// NUMBER GUESSING GAME const minNum = 1; const maxNum = 100; const answer = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum; let attempts = 0; let guess; let running = true; while(running){ guess = window.prompt(`Guess a number between ${minNum} - ${maxNum}`); guess = Number(guess); if(isNaN(guess)){ window.alert("Please enter a valid number"); } else if(guess < minNum || guess > maxNum){ window.alert("Please enter a valid number"); } else{ attempts++; if(guess < answer){ window.alert("TOO LOW! TRY AGAIN!"); } else if(guess > answer){ window.alert("TOO HIGH! TRY AGAIN!"); } else{ window.alert(`CORRECT! The answer was ${answer}. It took you ${attempts} attempts`); running = false; } } }
@DanielleScott-gh9bi8 ай бұрын
Wonderful! Thank you!!
@biryanibroseph2102 ай бұрын
Your tutorials are amazing , easy to understand , Thanku BroCode
@raghabpandit261022 күн бұрын
For those who tried to execute it with HTML ,CSS And JS . Dont use any loop it will run normally
@vasimhubli204210 ай бұрын
Your tutorials are underrated ❤
@RubyDaSnowLeopard Жыл бұрын
Great explanation 💙
@blocso5 ай бұрын
Great tutorial! I just would like to point out for those like me who tried to integrate with it HTML and CSS, that LOOPS can not be used in that case. Or at least my personal experience. I tried to create an input field and a submit button but in that case I used a SWITCH to make it work.
@raghabpandit261022 күн бұрын
can u comment the snippet?
@ivangerginov5648 Жыл бұрын
Great one! Thanks
@AbulKalam-8002 ай бұрын
Hey bro you tutorials are can easy understand ,,Thanks make this video❤
@hunin27 Жыл бұрын
Hey bro! I am waiting for other react tutorials or more complex javascript tutorials. I am waiting, no worries and lots of love ❤
@Kh-rf5fk Жыл бұрын
Hey Bro, thanks for making these tutorials! You make them so easy to understand and follow. Are there also any books or resources you can recommend for further learning?
@animehere59559 ай бұрын
Just FYI, theres an issue with the code. if we type 50, it recognizes the answer as correct ;=;
@Snayder-dk2sn Жыл бұрын
Please, man , use a dark theme , perhaps , you explain it coolly , I studied html and css now I switched to javascript !
@MzS_929 ай бұрын
Thank you!
@piotrmazgaj3 ай бұрын
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@Han15024Ай бұрын
I want a number guessing application that will come out on the interesting mall website✌
@gibberish005 ай бұрын
this code alone is not running. So do i need index.html and style.css for it to run??
@bhuvann82564 ай бұрын
no u dont
@drwajahathussain84556 ай бұрын
Hi Dear sir how are you doing I want to ask you something, I often forget the java code, what should I do to remember it?
@jamiebenish1534 Жыл бұрын
amazing video 👍🪿
@demonx_xgod6 ай бұрын
1:00
@Maskedlapis6411 ай бұрын
For me the ${} doesn’t do anything, it just prints that
@ARKGAMING11 ай бұрын
Make sure you're using template literals for your strings if you want it to work(` instead of ' or "), since it's the only string quotes that support this kind of formatting
@Saksham_17183 ай бұрын
are u using double qoutes or single qoutes ?? use ` ` these
@Saksham_17183 ай бұрын
nd make sure they have some value of what are u writing in between { } in these