Guess The Number Game Js

 let max = prompt("enter the number")

console.log(max);

const random = Math.floor(Math.random()*5)

let guess = prompt("enter the correct number")

while(true){
    if (guess =="quit"){
        console.log("user quit");
        break;
    }

    if(guess == random){
        console.log("you are write");
        break;
    }

    else if (guess < random){
        guess = prompt("your guess was to small")
    }
   
    else{
        guess = prompt("your guess was to Large")
 
    }

    // else {
    //     guess = prompt("your guess was wrong please try again")
    // }

}

Comments

Popular posts from this blog

practice test of Arithmetic Operations: