13_chess.js 210 B

1234567891011
  1. let str = '';
  2. let strDot = '.';
  3. let strHash = '#';
  4. for (let i = 0; i < 10; i++) {
  5. str += '\n';
  6. for (let j = 0; j < 12; j++) {
  7. str += ((i + j) % 2 === 0) ? strDot : strHash;
  8. }
  9. }
  10. console.log(str);