Skip to content

Instantly share code, notes, and snippets.

@hoganlong
Created December 17, 2020 20:32
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 hoganlong/58e24a586aed882a02d4bc5eb7fba166 to your computer and use it in GitHub Desktop.
Save hoganlong/58e24a586aed882a02d4bc5eb7fba166 to your computer and use it in GitHub Desktop.
let Uxxankyun = {
a: 8,
b: 6,
draw: function(x) {
document.write("<pre>");
if (x) {
for (let i = 0; i < this.a; i++) {
for (let j = 0; j < this.b; j++) {
document.write(" * ")
}
document.write(" <br> ")
}
document.write("<br>")
} else {
for (let i = 0; i <= this.a; i++) {
for (let j = 0; j <= this.b; j++) {
if (i == 0 || j == 0 || j == this.b || i == this.a || j == this.a) {
document.write("* ")
} else {
document.write(" ");
}
}
document.write("<br>")
}
}
document.write("</pre>");
}
}
Uxxankyun.draw(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment