1234567891011121314151617 |
- <head>chess</head>
- <body>
- <script>
- let lineSize = +prompt("Enter size of table line ");
- let str = "";
- for (let i = 0; i < lineSize; i++) {
- for (let j = 0; j < lineSize; j++) {
- str += ((j+i)% 2) == 0 ? "." : "#";
- }
- str += '\n';
- }
- alert(str);
- </script>
- </body>
|