Created
September 27, 2017 00:20
-
-
Save samc/1c3f960e7e1917c589f50b47e7edece6 to your computer and use it in GitHub Desktop.
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 q = 1; q < 10; q++) { | |
for (var qq = 1; qq < 4; qq++) { | |
if (qq == 1) { | |
for (var a = 1; a < 10; a++) { | |
text += (a <= q) ? '*' : ' ' | |
} | |
} | |
if (qq == 2) { | |
for (var b = 1; b < 10; b++) { | |
text += (b <= (10 -q)) ? '*' : ' ' | |
} | |
} | |
if (qq == 3) { | |
for (var c = 1; c < 10; c++) { | |
text += (c >= q) ? '*' : ' ' | |
} | |
} else { | |
for (var d = 1; d < 10; d++) { | |
text += (d >= (10 - q)) ? '*' : ' ' | |
} | |
console.log(text); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment