<script>
let range=null;
const setRange=()=>{
range=parseInt(prompt('please enter range since 0 to the number you want'));
}
setRange();
const generateNumber=(n)=>{
return Math.round(Math.random()*n);
}
let number=generateNumber(range);
console.log(number);
let userNumber=parseInt(10,prompt('please enter a number'));
(userNumber===number)?alert('you got it right congratulations'):
(userNumber>number)?alert(`you wrong the number is higher the correct number is ${number}`):
(userNumber<number)?alert(`you wrong the number is lower the correct number is ${number}`):
()=>{};
</script>