500
express this algorithm in words:
number=Math.floor(Math.random()*9 + 1); guess=prompt("I have a number from 1 to 9. Guess it."); numGuessesLeft=6; while ((numGuessesLeft > 0) && (guess != number)) { if (guess"); } else { document.write("Wrong! All your guesses are used up.
"); } document.write("The number was: " + number);
44
1. Pick a random number between 1 and 9
2. Ask user to guess it
3. Set number of guesses left to 6 4. Repeat as long as user has not guessed number yet, and number of guesses left is greater than 0: 1. If last guess was too high, tell user it is too high and give them another guess
2. Otherwise, tell user it is too low and give them another guess
5. Tell the user whether they’ve guessed correctly
6. Tell the user the number