mardi 7 avril 2015

Writing a Number Guessing program in JavaScript

Here is the question im trying to address and here is what I have. I am not sure what i've done wrong but it will not run in WebStorm:





alert("This is question 1");

var rndmNum = Math.rndmNum();
rndmNum = rndmNum * 100 + 1;
var i = 0;
do {
var rndmNum = prompt;

function guessNum(guess) {
if (guess < rndmNum);
}
alert("Your guess is too low");
} else if (guess > rndmNum) {
alert("Your guess is too high");
}



<!DOCTYPE html>
<html>

<head lang="en">
<meta charset="UTF-8">
<title>Question 1</title>
</head>

<body>
<h1>Question 1</h1>
<p>
This is a page used to run/execute some JavaScript.
</p>
<p>
Next <a href="question2.html">question</a>.
</p>
<p>
Return <a href="index.html">home</a>.
</p>
</body>

</html>



does anyone see any problems in what I have done or have any recommendations? Feedback is appreciated thanks





Aucun commentaire:

Enregistrer un commentaire