JavaScript NUMBER GUESSING GAME ↕

  Рет қаралды 32,025

Bro Code

Bro Code

Күн бұрын

Пікірлер: 27
@BroCodez
@BroCodez Жыл бұрын
// 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-gh9bi
@DanielleScott-gh9bi 8 ай бұрын
Wonderful! Thank you!!
@biryanibroseph210
@biryanibroseph210 2 ай бұрын
Your tutorials are amazing , easy to understand , Thanku BroCode
@raghabpandit2610
@raghabpandit2610 22 күн бұрын
For those who tried to execute it with HTML ,CSS And JS . Dont use any loop it will run normally
@vasimhubli2042
@vasimhubli2042 10 ай бұрын
Your tutorials are underrated ❤
@RubyDaSnowLeopard
@RubyDaSnowLeopard Жыл бұрын
Great explanation 💙
@blocso
@blocso 5 ай бұрын
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.
@raghabpandit2610
@raghabpandit2610 22 күн бұрын
can u comment the snippet?
@ivangerginov5648
@ivangerginov5648 Жыл бұрын
Great one! Thanks
@AbulKalam-800
@AbulKalam-800 2 ай бұрын
Hey bro you tutorials are can easy understand ,,Thanks make this video❤
@hunin27
@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
@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?
@animehere5955
@animehere5955 9 ай бұрын
Just FYI, theres an issue with the code. if we type 50, it recognizes the answer as correct ;=;
@Snayder-dk2sn
@Snayder-dk2sn Жыл бұрын
Please, man , use a dark theme , perhaps , you explain it coolly , I studied html and css now I switched to javascript !
@MzS_92
@MzS_92 9 ай бұрын
Thank you!
@piotrmazgaj
@piotrmazgaj 3 ай бұрын
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
@Han15024 Ай бұрын
I want a number guessing application that will come out on the interesting mall website✌
@gibberish00
@gibberish00 5 ай бұрын
this code alone is not running. So do i need index.html and style.css for it to run??
@bhuvann8256
@bhuvann8256 4 ай бұрын
no u dont
@drwajahathussain8455
@drwajahathussain8455 6 ай бұрын
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
@jamiebenish1534 Жыл бұрын
amazing video 👍🪿
@demonx_xgod
@demonx_xgod 6 ай бұрын
1:00
@Maskedlapis64
@Maskedlapis64 11 ай бұрын
For me the ${} doesn’t do anything, it just prints that
@ARKGAMING
@ARKGAMING 11 ай бұрын
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_1718
@Saksham_1718 3 ай бұрын
are u using double qoutes or single qoutes ?? use ` ` these
@Saksham_1718
@Saksham_1718 3 ай бұрын
nd make sure they have some value of what are u writing in between { } in these
@biryanibroseph210
@biryanibroseph210 2 ай бұрын
bro likes pizza
JavaScript FUNCTIONS are easy! 📞
12:14
Bro Code
Рет қаралды 47 М.
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 671 М.
小路飞和小丑也太帅了#家庭#搞笑 #funny #小丑 #cosplay
00:13
家庭搞笑日记
Рет қаралды 10 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 111 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 51 МЛН
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 290 М.
Number Guessing Game in Java Tutorial (Beginning to End)
14:34
Coding with John
Рет қаралды 64 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Build JavaScript ROCK PAPER SCISSORS in 18 minutes! 👊
18:54
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
Python Special Programs - Number Guessing Game
13:16
Neso Academy
Рет қаралды 10 М.
Awesome Javascript Number Guessing Game
9:54
Coding with Kenny
Рет қаралды 8 М.
A game of TicTacToe written in JavaScript ⭕
18:57
Bro Code
Рет қаралды 125 М.
小路飞和小丑也太帅了#家庭#搞笑 #funny #小丑 #cosplay
00:13
家庭搞笑日记
Рет қаралды 10 МЛН