Created
March 8, 2018 10:38
-
-
Save soner8/392a5ce02d0846d612ab31cb77ba5782 to your computer and use it in GitHub Desktop.
Solution JScripting
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" /> | |
</head> | |
<body> | |
<script> | |
function pyramid() { | |
for (var i = 1; i <= 7; i++) { | |
var row = ''; | |
for (var j = 1; j <= i; j++) { | |
row += '#'; | |
} | |
console.log(row); | |
} | |
} | |
var answer = prompt('Hey mon ami ! Tu aimes ça les patates ?'); | |
if ( answer.toLowerCase()[0] == 'o') { | |
pyramid(); | |
} | |
else if ( answer.toLowerCase()[0] == 'n') { | |
alert('Ho nooooooon :('); | |
} | |
else { | |
alert('Je vous sens comme tiraillé'); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment