Created
July 20, 2017 06:13
-
-
Save ronjunevaldoz/3a8c15a0c318be87688fb71001e9f327 to your computer and use it in GitHub Desktop.
Javascript Rectangle Asterisk
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 height = 5; | |
var width = 20; | |
for(var h = 0; h< height; h++) { | |
for(var w = 0; w< width; w++) { | |
if(w> 0 && w < width - 1) { | |
if(h> 0 && h < height - 1) { | |
$('#test').append('_'); | |
} else { | |
$('#test').append('*'); | |
} | |
} else { | |
$('#test').append('*'); | |
} | |
} | |
$('#test').append('<br>'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment