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?
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.
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
// 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;
}
}
}
Wonderful! Thank you!!
Great one! Thanks
Your tutorials are amazing , easy to understand , Thanku BroCode
Great explanation 💙
Your tutorials are underrated ❤
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?
Hey bro! I am waiting for other react tutorials or more complex javascript tutorials. I am waiting, no worries and lots of love ❤
Hey bro you tutorials are can easy understand ,,Thanks make this video❤
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.
can u comment the snippet?
For those who tried to execute it with HTML ,CSS And JS . Dont use any loop it will run normally
Thank you!
Please, man , use a dark theme , perhaps , you explain it coolly , I studied html and css now I switched to javascript !
Just FYI, theres an issue with the code. if we type 50, it recognizes the answer as correct ;=;
I want a number guessing application that will come out on the interesting mall website✌
1:00
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.
amazing video 👍🪿
this code alone is not running. So do i need index.html and style.css for it to run??
no u dont
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?
For me the ${} doesn’t do anything, it just prints that
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
are u using double qoutes or single qoutes ?? use ` ` these
nd make sure they have some value of what are u writing in between { } in these
bro likes pizza