123456789101112131415161718192021 |
- <head>rhomb</head><br>
- <br>
- <body>
- <script>
- let lineSize = +prompt("Enter Line size");
- const printLine = (num, lineSize) => {
- let leftOffset = (lineSize - num) / 2;
- let str = '.'.repeat(leftOffset) + '#'.repeat(num) + '.'.repeat(leftOffset);
- return str;
- }
- let a = "";
- for (i = -lineSize+1; i <= lineSize; i += 2) {
- a += "<a style='font-family : monospace,monospace;'>" + printLine(lineSize - Math.abs(i), lineSize) + "</a><br>";
- }
- document.write(a);
- </script>
- </body>
|