Created
April 19, 2017 09:33
-
-
Save abdu95/6bb8406ee8fdaebf125f21dea7882d07 to your computer and use it in GitHub Desktop.
// source http://jsbin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var text = ""; | |
for (var year = 2014; year <= 2050; year++) | |
{ | |
var d = new Date(year, 0, 1); | |
if ( d.getDay() === 0 ) | |
text+= "1st January is being a Sunday "+year+ "<br>"; | |
} | |
document.write(text); | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
//userNumber = window.prompt("Input a Number : "); | |
compNumber = Math.floor(Math.random()*10)+1; | |
if (userNumber == compNumber){ | |
alert("Good Work"); | |
} else { | |
alert("Not matched, actually it was " + compNumber); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
var text = ""; | |
for (var year = 2014; year <= 2050; year++) | |
{ | |
var d = new Date(year, 0, 1); | |
if ( d.getDay() === 0 ) | |
text+= "1st January is being a Sunday "+year+ "<br>"; | |
} | |
document.write(text); | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
//userNumber = window.prompt("Input a Number : "); | |
compNumber = Math.floor(Math.random()*10)+1; | |
if (userNumber == compNumber){ | |
alert("Good Work"); | |
} else { | |
alert("Not matched, actually it was " + compNumber); | |
}</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = ""; | |
for (var year = 2014; year <= 2050; year++) | |
{ | |
var d = new Date(year, 0, 1); | |
if ( d.getDay() === 0 ) | |
text+= "1st January is being a Sunday "+year+ "<br>"; | |
} | |
document.write(text); | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
/* where the program takes a random integer | |
between 1 to 10, the user is then prompted to input a guess | |
number. If the user input matches with guess number, | |
the program will display a message "Good Work" | |
otherwise display a message "Not matched".*/ | |
//userNumber = window.prompt("Input a Number : "); | |
compNumber = Math.floor(Math.random()*10)+1; | |
if (userNumber == compNumber){ | |
alert("Good Work"); | |
} else { | |
alert("Not matched, actually it was " + compNumber); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment