Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Guess-the-number/JavaScript/guess-the-number.js
Normal file
12
Task/Guess-the-number/JavaScript/guess-the-number.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function guessNumber() {
|
||||
// Get a random integer from 1 to 10 inclusive
|
||||
var num = Math.ceil(Math.random() * 10);
|
||||
var guess;
|
||||
|
||||
while (guess != num) {
|
||||
guess = prompt('Guess the number between 1 and 10 inclusive');
|
||||
}
|
||||
alert('Congratulations!\nThe number was ' + num);
|
||||
}
|
||||
|
||||
guessNumber();
|
||||
Loading…
Add table
Add a link
Reference in a new issue