Skip to content

Instantly share code, notes, and snippets.

@soner8
Created March 8, 2018 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soner8/392a5ce02d0846d612ab31cb77ba5782 to your computer and use it in GitHub Desktop.
Save soner8/392a5ce02d0846d612ab31cb77ba5782 to your computer and use it in GitHub Desktop.
Solution JScripting
<!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