hw10_09_chess.html 361 B

1234567891011121314151617
  1. <head>chess</head>
  2. <body>
  3. <script>
  4. let lineSize = +prompt("Enter size of table line ");
  5. let str = "";
  6. for (let i = 0; i < lineSize; i++) {
  7. for (let j = 0; j < lineSize; j++) {
  8. str += ((j+i)% 2) == 0 ? "." : "#";
  9. }
  10. str += '\n';
  11. }
  12. alert(str);
  13. </script>
  14. </body>